Oxygen Basic
Programming => Problems & Solutions => Topic started by: Brian Alvarez on May 07, 2018, 11:06:48 PM
-
Hello guys, What does this message mean:
"Must not assign to a direct string param"
Thanks.
-
Charles, i am getting stuck with a bunch of pretty vague error descriptions.
; ASM ERR: lea edi,sss_buffer!! Can't identify next operand '
; AFTER: ._direct_
; LINE: 25
I dont even see that in my code... Do you think you could use a few hours to describe a little more the errors? or explain where they come? I cant advance much with these speed bumps happening every few minutes. :(
-
If Charles doesn't get feedback from real world developers like yourself, the chances of O2 becoming production stable anytime soon is debatable. My experience has been as soon as Charles hears about an issue, it is resolved withing 48 hours normally. With PowerBASIC you had to wait until the next maintenance release. (which could have taken up to a year)
I was serious when I said you're chewing on raw BASIC but the flavor is intoxicating. :)
Trying to entertain users like Chris Chancellor is a waste of Charles's time if he wants a release of a BASIC compiler that's documented in his lifetime.
-
Hi Brian,
"Must not assign to a direct string param"
This means you must not alter a direct string param, as it would destroy the caller's string. You can either pass the string byref, or assign to another string, which you can alter without affecting the caller's string.
In the second error, you have an unidentified symbol: sss_buffer which has fallen through to the assembler. This suggests, to me, that you are trying to redim an array/variable which has already been defined statically. Dynamic arrays have an associated _buffer.
-
Charles, in the first case i was doing:
StdOutText = RTRIM_(StdOutText, 0, CHR(0)) + LBC
By direct string does it mean i cannot pass the variable being assigned with a value from StdOutText as a parameter of RTRIM_ even though it is being passed as BYVAL? Or that BYVAL parameters are read-only in oxygen basic?
would this help?:
StdOutText = RTRIM_(rtrim(StdOutText), 0, CHR(0)) + LBC
The reason i am asking this, is that i am not altering LBC which is the only parameter that is a literal string. StdOutText is a STR(ubound(SSS, 1)).
In the second case, i was testing the redim statement:
DIM LONG sss[100]
REDIM LONG sss[100]
How can i do it without causing trouble?
Thanks. :)
-
If Charles doesn't get feedback from real world developers like yourself, the chances of O2 becoming production stable anytime soon is debatable. My experience has been as soon as Charles hears about an issue, it is resolved withing 48 hours normally. With PowerBASIC you had to wait until the next maintenance release. (which could have taken up to a year)
Haha, it will just get worse. I usually test the most extreme circumstances. I hope i dont tire everybody here. :P
-
;D
The best and simplest solution is to use a new string inside your RTRIM_() procedure, and assign the first string param to it. o2 doesn't have an implict bycopy.
Dynamic arrays must be declared using redim from the start. You can create an empty array if you are not ready to allocate elements yet:
redim int a(0)
-
o2 doesn't have an implict bycopy.
No problem, PluriBASIC does and can generate the code for oxygen. But it seems to be accepting the BYVAL switch. Is it just ignoring it?
Dynamic arrays must be declared using redim from the start. You can create an empty array if you are not ready to allocate elements yet:
redim int a(0)
Okay, no problem... but then how do i redim with no preserve and redim with preserve?
-
I get similar msg few days back but now seems that work :o
'str = rtrim str
string StdOutText = "Oxygen "
StdOutText = RTRIM(StdOutText)
print StdOutText