Author Topic: Len Function  (Read 1898 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Len Function
« on: April 08, 2015, 10:43:52 AM »
Deleted
« Last Edit: May 05, 2015, 11:12:22 AM by Peter »

Charles Pegge

  • Guest
Re: Len Function
« Reply #1 on: April 08, 2015, 12:32:11 PM »
Peter,

countof cars will give you the static array count.

len cars is the same as len cars[0]

Code: OxygenBasic
  1. include "asm.inc"
  2. window 640,480,1
  3.  
  4. string cars = {"BMW","VOLVO","SAAB","FORD","OPEL","RENAULT","MERCEDES"}
  5.  
  6. for i=0 to < countof cars
  7.     text 10,i*12,10,cars[i]
  8. next
  9.  
  10. for i=0 to 6
  11.     text 90,i*12,10,cars[i]
  12. next
  13.  
  14. waitkey
  15. winExit
  16.  

Aurel

  • Guest
Re: Len Function
« Reply #2 on: April 08, 2015, 02:55:09 PM »
Quote
countof was not known to me until now!
yes for me to.. ???

Charles Pegge

  • Guest
Re: Len Function
« Reply #3 on: April 08, 2015, 07:49:43 PM »
There are a few more ofs, mostly used for diagnostics, returning numbers or strings.

Here is the current list:

sizeof
offsetof
countof / spanof
bytesof
typecodeof

typeof
structureof / encodingof
prototypeof
recordof



PS: plasma.exe works on my PC