Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
undocumented Len function
#1
in the Wiki the Len function is described for strings only but QBasic uses the Len function also to get the size in bytes of data types including udts
but QB64pe also gives the size in bytes of an array, but this seems to be a feature and it behaves strangely
the following works and prints 50, 100 and 200
Code: (Select All)

Dim As Integer i(4, 4)
Dim As Long l(4, 4)
Dim As _Integer64 ll(4, 4)

Print Len(i())
Print Len(l())
Print Len(ll())
but if you add the following
Code: (Select All)

Print Len(l()) / Len(i())
it prints 100 instead of 2, the division never takes place
I think that getting the SizeOf an array would be nice to have and it almost works, perhaps the developers could fix it so that the last statement would be evaluated correctly
Reply


Messages In This Thread
undocumented Len function - by Jack - 08-16-2024, 03:39 PM
RE: undocumented Len function - by SMcNeill - 08-16-2024, 03:54 PM
RE: undocumented Len function - by RhoSigma - 08-16-2024, 04:47 PM
RE: undocumented Len function - by Jack - 08-16-2024, 04:54 PM



Users browsing this thread: 2 Guest(s)