Hi,
in our VO-Application we have implemented the library VOSCRIPT and we use scripting a lot in order to adjust the behaviour of the programm according to the wishes of our customers. Porting the source of VOSCRIPT to x# is essential for us. In a first test there seems to be only one big problem. Scripting variables are created via
local cVarname as string
local uValue as usual
cVarname := .....
uValue := ...
PRIVATE &cVarname
&cVarname := uValue
x# doesn't accept this code. Is there any chance to make this possible or is there a smarter workaround ?
memvarput() does not show the same result as the original code.
TIA
Karl
VOScript
VOScript
Hi Karl,
Hmm, good point, I think this was just overlooked. I think it can be implemented, but not totally sure. We will have a look into this and will get back to you in a few days.
Hmm, good point, I think this was just overlooked. I think it can be implemented, but not totally sure. We will have a look into this and will get back to you in a few days.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
VOScript
Hi Chris,
VOScript was used by a lot of people - and it was distributed with VO 2.6.
I have a regular (paid) & source code license of it, and I had tried to contact the author a few years ago, but wasn't able to reach him.
Wolfgang
VOScript was used by a lot of people - and it was distributed with VO 2.6.
I have a regular (paid) & source code license of it, and I had tried to contact the author a few years ago, but wasn't able to reach him.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
VOScript
Guys,
The functionality already exists, but not the syntax for handling memvars with the & syntax. This works already just fine:
so theoretically all the code can be modified above and it should work fine in X# as well. But I *think* it will be possible to support the original syntax as well, so no code changes will be necessary.
The functionality already exists, but not the syntax for handling memvars with the & syntax. This works already just fine:
Code: Select all
FUNCTION Start() AS VOID
LOCAL cVarname AS USUAL
cVarname := "myprivate"
// Declare private:
__MemVardecl(cVarname , TRUE)
// Assign value
__MemVarPut(cVarname , "abc")
// Read value
? __MemVarGet(cVarname)
// this also works of course
? myprivate
so theoretically all the code can be modified above and it should work fine in X# as well. But I *think* it will be possible to support the original syntax as well, so no code changes will be necessary.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
VOScript
Hi Karl,
Ah, so it's should be easy! In that case maybe you could also rewrite this small piece of code so that it uses something different than PRIVATEs, something like a Dictionary maybe for holding the values. It is not necessary, would probably just make the code faster and easier to read.
Ah, so it's should be easy! In that case maybe you could also rewrite this small piece of code so that it uses something different than PRIVATEs, something like a Dictionary maybe for holding the values. It is not necessary, would probably just make the code faster and easier to read.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
VOScript
Guys,
in the last months i posted a lot memvar samples. I "love" memvars - why struggle with tons of typed locals if the job can be done with two or three privates/publics instead ? Ok, just kidding![Smile :-)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_smile.gif)
regards
Karl-Heinz
in the last months i posted a lot memvar samples. I "love" memvars - why struggle with tons of typed locals if the job can be done with two or three privates/publics instead ? Ok, just kidding
![Smile :-)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_smile.gif)
regards
Karl-Heinz
VOScript
Hi Karl-Heinz,
I'm using memvars also a lot, but never in "normal" code, but in dynamic code, mostly in my report engine where I use MemVarPut() a lot (to set report variables).
Wolfgang
I'm using memvars also a lot, but never in "normal" code, but in dynamic code, mostly in my report engine where I use MemVarPut() a lot (to set report variables).
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
VOScript
Hi Wolfgang,
in "normal" VO code memvars are a no go. To be honest, in the past 25 VO years i never had the need to use privates/publics. Of course, for our VFP friends, or if you are using scripting memvars are a must.
regards
Karl-Heinz
in "normal" VO code memvars are a no go. To be honest, in the past 25 VO years i never had the need to use privates/publics. Of course, for our VFP friends, or if you are using scripting memvars are a must.
regards
Karl-Heinz