Oxygen Basic
Information => Development => Topic started by: Brian Alvarez on May 25, 2019, 09:15:11 AM
-
This is giving me hell (pun intended):
FUNCTION TESTIT1(zstring2 zText) AS LONG
print ztext
print chr(13, 10) ' print separately to make sure we are not contaminating the ztext
END FUNCTION
FUNCTION TESTIT2(zstring2 zText[32]) AS LONG
print ztext
print chr(13, 10) ' print separately to make sure we are not contaminating the ztext
END FUNCTION
ZSTRING2 test1
ZSTRING2 test2[32]
test1 = "Hello World"
test2 = "World Hello"
testit1 test1
testit2 test1
testit1 test2
testit2 test2
The output is:
Hell
HellWorld Hello
Worl
World Hello
I dont know if this is the data in the test variables being corrupted or print not being able to display the strings correctly,
If the first case, how can i make sure i am not doing anything wrong?
If the second case, How can i convert the strings for correct display?
-
HELLO2 ;D
-
Yo Brian
This work:
FUNCTION TESTIT1(byref ztext as zstring2 ) AS LONG
print ztext
print chr(13, 10) ' print separately to make sure we are not contaminating the ztext
END FUNCTION
FUNCTION TESTIT2(zstring2 zText[32]) AS LONG
print ztext
print chr(13, 10) ' print separately to make sure we are not contaminating the ztext
END FUNCTION
ZSTRING2 test1 = "Hello World"
ZSTRING2 test2[32] = "World-Hello"
testit1 (test1)
testit2 test1
testit1 test2
testit2 test2
You confuse o2 with declare nothing then with declare something :D
-
Thanks Aurel. This makes sense. :)
I thought the ZSTRING2 was dynamic length because it was allowing me to define it with no initial contents.