Author Topic: "len" command isn't correct  (Read 2179 times)

0 Members and 1 Guest are viewing this topic.

Frankolinox

  • Guest
"len" command isn't correct
« on: April 03, 2013, 07:53:22 AM »
a) I've downloaded latest oxygen package at the early afternoon. now the "len" command seems to be wrong:

Code: [Select]
''
'' something is uncorrect with "len" command
''
byte ByteLen
byte p 'AS BYTE 'POINTER

ByteLen = len(p)  ' size of a pointer = 4 bytes

print str(bytelen) ' result should be: 4 ' correct! :)

'but oxy says however "0"


b) and I've noticed after checking "AsciEditor" (projectsB/scintilla/) thats an error occured for line 149 and that's concerning "len(iccx)" command too.

best regards, frank

X
« Last Edit: April 03, 2013, 08:00:20 AM by Frankolinox »

Frankolinox

  • Guest
Re: "len" command isn't correct
« Reply #1 on: April 03, 2013, 08:50:38 AM »
yes, sorry of course, I am not very fit at the moment (the cold days are trembling my thoughts!), thanks peter, but the problem with "ASciEdit" example still remains, the example worked last days very fine ;)

Charles Pegge

  • Guest
Re: "len" command isn't correct
« Reply #2 on: April 03, 2013, 09:15:13 AM »
Hi Frank, Just to clarify:

byte b
byte *p

print sizeof b '1
print sizeof p '1
print sizeof sys '4 or 8 all pointers (&p) are sys (32bit or 64 bit)

Frankolinox

  • Guest
Re: "len" command isn't correct
« Reply #3 on: April 03, 2013, 10:11:39 AM »
thank you charles for clarification, it's not my day  ::)

my little "len()" example:

Code: [Select]
sys var1,var2
string festerText
wstring zstr
festerText = "TestAlpha" ' 9
zstr       = "TestBeta"  ' 8
print len(festerText)
print len(zstr)

var1=240
print str(len(var1)) ' 3
'all correct here! ;)


b) in example "AsciEdit.o2bas" I have changed this line from len() into sizeof() and all is working fine here, thank you peter for your tipp!

Quote
you must take sizeOf()

Code: [Select]
iccx.dwSize = sizeof(iccx) 'len(iccx )
so in that example from aurel this line 149 has to be fixed with "sizeof(iccx)" for a next oxygen update issue.

best regards, frank