Re: [ql-users] Sbasic and macro substitutions

2003-02-21 Thread François Van Emelen
P Witte wrote: François Van Emelen writes: There is be no need to keep opening and closing channels or even re-executing the SBasic interpreter. As my program demonstrated you can simply keep it plumbed in for re-use for as long as you need it. Youd only have to set it up again if it crashe

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread P Witte
François Van Emelen writes: > Hi Marcel, > Thank you for your answer. > > Wouldn't there be a problem when your Eval$(e$)function is used 1000s of > times? > Isn't there a limit to the number of times a channel can be opened and > closed in a program? There is be no need to keep opening and cl

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread Phoebus Dokos
On Thu, 20 Feb 2003 13:22:15 +0100, Fran��§ois Van Emelen <[EMAIL PROTECTED]> wrote: I didn't know that! Do you mean that you can MERGE or MRUN a file in a TURBOed program? Can this be done? 500 MERGE 'ram1_my_prog_bas' THIS (as in what's written above) No. But a simil

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread François Van Emelen
Phoebus Dokos wrote: On Thu, 20 Feb 2003 10:22:38 +0100, François Van Emelen <[EMAIL PROTECTED]> wrote: P Witte wrote: This was the sort devious stuff one was expected to do in Archive. In SuperBasic it is easiest just to MERGE or MRUN the code. Why go to all this trouble? I know,

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread François Van Emelen
Hi Wolfgang, [EMAIL PROTECTED] wrote: On 20 Feb 2003 at 10:01, François Van Emelen wrote: Hi Marcel, Thank you for your answer. Wouldn't there be a problem when your Eval$(e$)function is used 1000s of times? Isn't there a limit to the number of times a channel can be opened and closed in

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread François Van Emelen
Hi Wolfgang, [EMAIL PROTECTED] wrote: On 20 Feb 2003 at 10:42, [EMAIL PROTECTED] wrote: DEFine FuNction val$ (command$,parameter$) Oops I don't know why that was sent - Marcel has already posted this solution. Sorry. Wolfgang Thanks, anyway Regards François Van Emelen

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread Phoebus Dokos
On Thu, 20 Feb 2003 10:22:38 +0100, François Van Emelen <[EMAIL PROTECTED]> wrote: P Witte wrote: This was the sort devious stuff one was expected to do in Archive. In SuperBasic it is easiest just to MERGE or MRUN the code. Why go to all this trouble? I know, I used to do that in Arc

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread wlenerz
On 20 Feb 2003 at 10:42, [EMAIL PROTECTED] wrote: > DEFine FuNction val$ (command$,parameter$) Oops I don't know why that was sent - Marcel has already posted this solution. Sorry. Wolfgang

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread François Van Emelen
Hi Phoebus, Phoebus Dokos wrote: On Thu, 20 Feb 2003 10:01:28 +0100, François Van Emelen Wouldn't there be a problem when your Eval$(e$)function is used 1000s of times? Isn't there a limit to the number of times a channel can be opened and closed in a program? I don't see why... I'

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread wlenerz
On 20 Feb 2003 at 10:01, François Van Emelen wrote: > Hi Marcel, > Thank you for your answer. > > Wouldn't there be a problem when your Eval$(e$)function is used 1000s of > times? > Isn't there a limit to the number of times a channel can be opened and > closed in a program? > François Van Emel

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread wlenerz
On 19 Feb 2003 at 17:55, François Van Emelen wrote: > It is rather a function that acts upon the content of a string variable > as if it had been typed in on the command line. > example: > 100 my_string$="qdos" > 120 my_new_string$=XYZ("upper$"&"("&my_string$&")") > 130 rem XYZ => name of the fun

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread Phoebus Dokos
On Thu, 20 Feb 2003 10:01:28 +0100, François Van Emelen <[EMAIL PROTECTED]> wrote: Marcel Kilgus wrote: Any suggestions? What about this quick&moderately dirty approach of employing the existing SBasic parser? 100 r$= '(' 110 l$ = ')' 120 f$ = 'UPPER$' 130 v$ = '"ql-smsq"' 140 c$ = f$

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread François Van Emelen
P Witte wrote: This was the sort devious stuff one was expected to do in Archive. In SuperBasic it is easiest just to MERGE or MRUN the code. Why go to all this trouble? I know, I used to do that in Archive. MERGE and MRUN can't be used in a compiled program. SBasic has other possibilitie

Re: [ql-users] Sbasic and macro substitutions

2003-02-20 Thread François Van Emelen
Marcel Kilgus wrote: Any suggestions? What about this quick&moderately dirty approach of employing the existing SBasic parser? 100 r$= '(' 110 l$ = ')' 120 f$ = 'UPPER$' 130 v$ = '"ql-smsq"' 140 c$ = f$ & r$ & v$ & l$ 150 PRINT Eval$(c$) 160 STOP 990 : 1000 DEFine FuNction Eval$(e$) 1010 LO

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread Phoebus Dokos
On Wed, 19 Feb 2003 19:38:44 -0800, Timothy Swenson <[EMAIL PROTECTED]> wrote: At 05:55 PM 2/19/2003 +0100, you wrote: Hi Tim, Thank you for your reply, but my example has mislead you somewhat,I'm afraid. Macro substitution is something completely different from 'IF DEF's' or '#INCLUDE'( if

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread Timothy Swenson
At 05:55 PM 2/19/2003 +0100, you wrote: Hi Tim, Thank you for your reply, but my example has mislead you somewhat,I'm afraid. Macro substitution is something completely different from 'IF DEF's' or '#INCLUDE'( if I do understand your explanation correctly). I gather from TT's reply that I was

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread P Witte
François Van Emelen writes: > 100 rem macro_bas > 110 REMark example of substitution /VAL > 120 res1$="res1$=" :res2$="res2$=" :REMark res1$ string res2$ num > 130 L1$='(' :R1$=")": f1$='upper$': string1$="'qdos'" > 140 num1$="20":num2$="5":f2$="*" > 150 OPEN_OVER#3,ram1_mac_do > 160 PRINT#3,res

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread François Van Emelen
rn to mac_bas but to job 225 rem 0/command line 230 rem type 'print res1$,res2$ on the command line 235 rem and 'QDOS', '200' will be displayed Thank you for reading this . Kind regards François Van Emelen Tony Tebby - Original Message - From: "François Van E

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread François Van Emelen
epends on the value of xxx and can change during execution, but SBASIC compiles the end of the loop before execution. This trick does work in Javascript because it is purely and slowly interpreted. Any suggestions? Tony Tebby - Original Message - From: "François Van Emelen&quo

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread François Van Emelen
Hi Tim, Thank you for your reply, but my example has mislead you somewhat,I'm afraid. Macro substitution is something completely different from 'IF DEF's' or '#INCLUDE'( if I do understand your explanation correctly). It is rather a function that acts upon the content of a string variable as if

RE: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread Norman Dunbar
Hi Phoebus, >> Recently someone at the university asked me why I still used SBasic (and I >> usually bring to the labs a QPC Zip disk)... I challenged him to do a >> vector addition program (with Graphics) in any Basic and it to be under 5 >> lines of code and it to be precise enough for the r

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread Phoebus Dokos
On Wed, 19 Feb 2003 12:18:29 +0100, TonyTebby <[EMAIL PROTECTED]> wrote: This "macro substitution" in Foxpro is not really anything to do with macros - it is a run-time expression evaluator that parses and evaluates a string. Foxpro can do it because it is based on early purely interpreted Bi

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread Marcel Kilgus
TonyTebby wrote: First of all, thank you for your work on SBasic. After having had a look at the code (and, hear hear, documentation ;-) ) I must say I think its design is very elegant and despite the complexity the code is comparatively easy to read, which is amazing really. > Compilation > 1)

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread Marcel Kilgus
TonyTebby wrote: > Preprocessor macros, however, provide a great way of writing C programs so > that they are not nearly undecipherable as usual, but totally > incomprehensible. Some guy once said that checking whether the syntax of a C source is valid is equivalent to the Touring machine halt pr

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread TonyTebby
C programs so that they are not nearly undecipherable as usual, but totally incomprehensible. Tony Tebby - Original Message - From: "Timothy Swenson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: mercredi 19 février 2003 05:50 Subject: Re: [ql-users] Sbasic a

Re: [ql-users] Sbasic and macro substitutions

2003-02-19 Thread TonyTebby
essage - From: "François Van Emelen" <[EMAIL PROTECTED]> To: "QL users list" <[EMAIL PROTECTED]>; "François Van Emelen" <[EMAIL PROTECTED]> Sent: mardi 18 février 2003 17:34 Subject: [ql-users] Sbasic and macro substitutions > > Hi all, > >

Re: [ql-users] Sbasic and macro substitutions

2003-02-18 Thread Timothy Swenson
I don't believe there is a way of performing macro substitution in S*BASIC programming. Now, it can probably be implemented in one form or another. The most obvious is a pre-processor that takes a macro and expands it before the program is actually sent to a compiler or parser. C has a pre-p

[ql-users] Sbasic and macro substitutions

2003-02-18 Thread François Van Emelen
Hi all, I've been using Foxpro v2 (programmable database system) for several years now and 'macro substitution' is one of those powerful functions I use a lot in my programmes. I wonder whether such a function is available (possible?) in Sbasic. Here's an example of a 'macro substitution': l=