syntax problem in quickbasic
Author |
Message |
David Willia #1 / 20
|
 syntax problem in quickbasic
-> >I still have the same problem -> >"type mismatch ;eorr code :13 -> >for the code : -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ found. -> Try: -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. -> >ufn$ = LEFT$(C$, LEN(C$) - 4) It's worth noting that strange things sometimes happen if a comment is put immediately after THEN. BASIC checks IF statements to see if they are the one-line variety e.g.: IF X = 1 THEN PRINT "One" or the multi-line kind: IF X = 1 THEN PRINT "One" END IF If any code follows the word THEN, BASIC assumes that a one-line IF is involved. A comment can be seen as code, causing things to go wrong. This shouldn't happen if there is at least one space between the THEN and the comment, but it's easy to forget to include this space. dow
|
Sat, 14 Jan 2006 10:42:33 GMT |
|
 |
nos.. #2 / 20
|
 syntax problem in quickbasic
Quote:
> -> >I still have the same problem > -> >"type mismatch ;eorr code :13 > -> >for the code : > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ found. > -> Try: > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) > It's worth noting that strange things sometimes happen if a comment is > put immediately after THEN. BASIC checks IF statements to see if they > are the one-line variety e.g.: > IF X = 1 THEN PRINT "One" > or the multi-line kind: > IF X = 1 THEN > PRINT "One" > END IF > If any code follows the word THEN, BASIC assumes that a one-line IF is > involved. A comment can be seen as code, causing things to go wrong. > This shouldn't happen if there is at least one space between the THEN > and the comment, but it's easy to forget to include this space. > dow
BS Never (20+ years) had a problwm with a comment after a THEN LB
|
Sat, 14 Jan 2006 18:22:35 GMT |
|
 |
Michael Mattia #3 / 20
|
 syntax problem in quickbasic
Quote:
> > -> >I still have the same problem > > -> >"type mismatch ;eorr code :13 > > -> >for the code : > > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ found. > > -> Try: > > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. > > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) > > It's worth noting that strange things sometimes happen if a comment is > > put immediately after THEN. BASIC checks IF statements to see if they > > are the one-line variety e.g.: > > IF X = 1 THEN PRINT "One" > > or the multi-line kind: > > IF X = 1 THEN > > PRINT "One" > > END IF > > If any code follows the word THEN, BASIC assumes that a one-line IF is > > involved. A comment can be seen as code, causing things to go wrong. > > This shouldn't happen if there is at least one space between the THEN > > and the comment, but it's easy to forget to include this space. > > dow > BS Never (20+ years) had a problwm with a comment after a THEN
Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need more experience. MCM
|
Sat, 14 Jan 2006 19:57:34 GMT |
|
 |
Doole #4 / 20
|
 syntax problem in quickbasic
this works just fine, with more than one line in the if loop cls 'to clear previous test screen c$ = "shit.s2p" 'test c$ I made up test$ = right$(c$,4) 'made up string to test if ucase$(test$) =".S2P" then 'test string ufn$ = left$(cs, len(c$) - 4) 'assign value to ufn$ Print ufn$ 'print value End if 'end if loop
Quote:
> > > -> >I still have the same problem > > > -> >"type mismatch ;eorr code :13 > > > -> >for the code : > > > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ found. > > > -> Try: > > > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. > > > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) > > > It's worth noting that strange things sometimes happen if a comment is > > > put immediately after THEN. BASIC checks IF statements to see if they > > > are the one-line variety e.g.: > > > IF X = 1 THEN PRINT "One" > > > or the multi-line kind: > > > IF X = 1 THEN > > > PRINT "One" > > > END IF > > > If any code follows the word THEN, BASIC assumes that a one-line IF is > > > involved. A comment can be seen as code, causing things to go wrong. > > > This shouldn't happen if there is at least one space between the THEN > > > and the comment, but it's easy to forget to include this space. > > > dow > > BS Never (20+ years) had a problwm with a comment after a THEN > Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need > more experience. > MCM
|
Sat, 14 Jan 2006 21:14:25 GMT |
|
 |
Doole #5 / 20
|
 syntax problem in quickbasic
the word screen in the second line was a carry over from the upper remark statement
Quote: > this works just fine, with more than one line in the if loop > cls 'to clear previous test > screen > c$ = "shit.s2p" 'test c$ I made up > test$ = right$(c$,4) 'made up string to test > if ucase$(test$) =".S2P" then 'test string > ufn$ = left$(cs, len(c$) - 4) 'assign value to ufn$ > Print ufn$ 'print value > End if 'end if loop
> > > > -> >I still have the same problem > > > > -> >"type mismatch ;eorr code :13 > > > > -> >for the code : > > > > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ found. > > > > -> Try: > > > > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. > > > > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) > > > > It's worth noting that strange things sometimes happen if a comment is > > > > put immediately after THEN. BASIC checks IF statements to see if they > > > > are the one-line variety e.g.: > > > > IF X = 1 THEN PRINT "One" > > > > or the multi-line kind: > > > > IF X = 1 THEN > > > > PRINT "One" > > > > END IF > > > > If any code follows the word THEN, BASIC assumes that a one-line IF is > > > > involved. A comment can be seen as code, causing things to go wrong. > > > > This shouldn't happen if there is at least one space between the THEN > > > > and the comment, but it's easy to forget to include this space. > > > > dow > > > BS Never (20+ years) had a problwm with a comment after a THEN > > Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need > > more experience. > > MCM
|
Sat, 14 Jan 2006 21:18:44 GMT |
|
 |
yehonat #6 / 20
|
 syntax problem in quickbasic
Dooley and frinds thank you it works ,my new problem is that is not read the s2p file which is: ======================================== ! ATF-10236 S AND NOISE PARAMETERS ! Vds=2V Id=25mA ! LAST UPDATED 06-28-89 !FREQ S11 S21 S12 S22 !GHZ MAG ANG MAG ANG MAG ANG MAG ANG 0.5 .97 -20 5.68 162 .023 76 .47 -11 1.0 .93 -41 5.58 143 .050 71 .45 -23 2.0 .77 -81 4.76 107 .086 51 .36 -38 3.0 .59 -114 4.06 80 .120 35 .30 -51 4.0 .48 -148 3.51 52 .149 18 .23 -67 5.0 .46 166 3.03 26 .172 3 .10 -67 6.0 .53 125 2.65 1 .189 -14 .09 48 7.0 .62 96 2.22 -20 .191 -28 .24 55 8.0 .71 73 1.75 -39 .189 -41 .37 51 9.0 .75 54 1.47 -55 .184 -46 .46 42 10.0 .78 39 1.28 -72 .180 -59 .51 34 11.0 .82 26 1.04 -86 .179 -71 .54 26 12.0 .84 12 .95 -101 .177 -82 .54 17 !FREQ Fopt GAMMA OPT RN/Zo !GHZ dB MAG ANG - 0.5 0.4 .94 16 0.78 1.0 0.5 .87 36 0.63 2.0 0.6 .73 74 0.33 4.0 0.8 .45 148 0.15 6.0 1.0 .42 -137 0.12 8.0 1.3 .49 -80 0.45 12.0 1.6 .65 -20 1.16 ================================== i get error didnt find 9 numbers parsing the o following data line 0.5 .97 -20 5.68 162 .023 76 .47 -11 what is wrong in the code? Quote:
> the word screen in the second line was a carry over from the upper remark > statement
> > this works just fine, with more than one line in the if loop > > cls 'to clear previous test > > screen > > c$ = "shit.s2p" 'test c$ I made up > > test$ = right$(c$,4) 'made up string to test > > if ucase$(test$) =".S2P" then 'test string > > ufn$ = left$(cs, len(c$) - 4) 'assign value to ufn$ > > Print ufn$ 'print value > > End if 'end if loop
> > > > > -> >I still have the same problem > > > > > -> >"type mismatch ;eorr code :13 > > > > > -> >for the code : > > > > > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ > found. > > > > > -> Try: > > > > > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. > > > > > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) > > > > > It's worth noting that strange things sometimes happen if a comment > is > > > > > put immediately after THEN. BASIC checks IF statements to see if > they > > > > > are the one-line variety e.g.: > > > > > IF X = 1 THEN PRINT "One" > > > > > or the multi-line kind: > > > > > IF X = 1 THEN > > > > > PRINT "One" > > > > > END IF > > > > > If any code follows the word THEN, BASIC assumes that a one-line IF > is > > > > > involved. A comment can be seen as code, causing things to go wrong. > > > > > This shouldn't happen if there is at least one space between the > THEN > > > > > and the comment, but it's easy to forget to include this space. > > > > > dow > > > > BS Never (20+ years) had a problwm with a comment after a THEN > > > Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need > > > more experience. > > > MCM
|
Sun, 15 Jan 2006 04:48:01 GMT |
|
 |
Doole #7 / 20
|
 syntax problem in quickbasic
that I have no idea, I had to reinstall QB just to solve your problem, sorry
Quote: > Dooley and frinds thank you it works ,my new problem is that is not read the > s2p file which is: > ======================================== > ! ATF-10236 S AND NOISE PARAMETERS > ! Vds=2V Id=25mA > ! LAST UPDATED 06-28-89 > !FREQ S11 S21 S12 S22 > !GHZ MAG ANG MAG ANG MAG ANG MAG ANG > 0.5 .97 -20 5.68 162 .023 76 .47 -11 > 1.0 .93 -41 5.58 143 .050 71 .45 -23 > 2.0 .77 -81 4.76 107 .086 51 .36 -38 > 3.0 .59 -114 4.06 80 .120 35 .30 -51 > 4.0 .48 -148 3.51 52 .149 18 .23 -67 > 5.0 .46 166 3.03 26 .172 3 .10 -67 > 6.0 .53 125 2.65 1 .189 -14 .09 48 > 7.0 .62 96 2.22 -20 .191 -28 .24 55 > 8.0 .71 73 1.75 -39 .189 -41 .37 51 > 9.0 .75 54 1.47 -55 .184 -46 .46 42 > 10.0 .78 39 1.28 -72 .180 -59 .51 34 > 11.0 .82 26 1.04 -86 .179 -71 .54 26 > 12.0 .84 12 .95 -101 .177 -82 .54 17 > !FREQ Fopt GAMMA OPT RN/Zo > !GHZ dB MAG ANG - > 0.5 0.4 .94 16 0.78 > 1.0 0.5 .87 36 0.63 > 2.0 0.6 .73 74 0.33 > 4.0 0.8 .45 148 0.15 > 6.0 1.0 .42 -137 0.12 > 8.0 1.3 .49 -80 0.45 > 12.0 1.6 .65 -20 1.16 > ================================== > i get error > didnt find 9 numbers parsing the o > following data line > 0.5 .97 -20 5.68 162 .023 76 .47 -11 > what is wrong in the code?
Quote: > > the word screen in the second line was a carry over from the upper remark > > statement
> > > this works just fine, with more than one line in the if loop > > > cls 'to clear previous test > > > screen > > > c$ = "shit.s2p" 'test c$ I made up > > > test$ = right$(c$,4) 'made up string to test > > > if ucase$(test$) =".S2P" then 'test string > > > ufn$ = left$(cs, len(c$) - 4) 'assign value to ufn$ > > > Print ufn$ 'print value > > > End if 'end if loop
> > > > > > -> >I still have the same problem > > > > > > -> >"type mismatch ;eorr code :13 > > > > > > -> >for the code : > > > > > > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ > > found. > > > > > > -> Try: > > > > > > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. > > > > > > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) > > > > > > It's worth noting that strange things sometimes happen if a comment > > is > > > > > > put immediately after THEN. BASIC checks IF statements to see if > > they > > > > > > are the one-line variety e.g.: > > > > > > IF X = 1 THEN PRINT "One" > > > > > > or the multi-line kind: > > > > > > IF X = 1 THEN > > > > > > PRINT "One" > > > > > > END IF > > > > > > If any code follows the word THEN, BASIC assumes that a one-line IF > > is > > > > > > involved. A comment can be seen as code, causing things to go wrong. > > > > > > This shouldn't happen if there is at least one space between the > > THEN > > > > > > and the comment, but it's easy to forget to include this space. > > > > > > dow > > > > > BS Never (20+ years) had a problwm with a comment after a THEN > > > > Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need > > > > more experience. > > > > MCM
|
Sun, 15 Jan 2006 07:39:17 GMT |
|
 |
arargh307NOS.. #8 / 20
|
 syntax problem in quickbasic
Quote: >Dooley and frinds thank you it works ,my new problem is that is not read the <snip> >i get error >didnt find 9 numbers parsing the o >following data line >0.5 .97 -20 5.68 162 .023 76 .47 -11 >what is wrong in the code?
Where is the code? <snip> -- Arargh307 at [drop the 'http://www.' from ->] http://www.arargh.com BCET Basic Compiler Page: http://www.arargh.com/basic/index.html To reply by email, remove the garbage from the reply address.
|
Sun, 15 Jan 2006 08:15:05 GMT |
|
 |
yehonat #9 / 20
|
 syntax problem in quickbasic
The code is in the first message Quote:
> >Dooley and frinds thank you it works ,my new problem is that is not read the > <snip> > >i get error > >didnt find 9 numbers parsing the o > >following data line > >0.5 .97 -20 5.68 162 .023 76 .47 -11 > >what is wrong in the code? > Where is the code? > <snip>
|
Sun, 15 Jan 2006 15:57:27 GMT |
|
 |
nos.. #10 / 20
|
 syntax problem in quickbasic
Quote:
> > > -> >I still have the same problem > > > -> >"type mismatch ;eorr code :13 > > > -> >for the code : > > > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ found. > > > -> Try: > > > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. > > > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) > > > It's worth noting that strange things sometimes happen if a comment is > > > put immediately after THEN. BASIC checks IF statements to see if they > > > are the one-line variety e.g.: > > > IF X = 1 THEN PRINT "One" > > > or the multi-line kind: > > > IF X = 1 THEN > > > PRINT "One" > > > END IF > > > If any code follows the word THEN, BASIC assumes that a one-line IF is > > > involved. A comment can be seen as code, causing things to go wrong. > > > This shouldn't happen if there is at least one space between the THEN > > > and the comment, but it's easy to forget to include this space. > > > dow > > BS Never (20+ years) had a problwm with a comment after a THEN > Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need > more experience. > MCM
You still have much hair? LB
|
Sun, 15 Jan 2006 16:40:05 GMT |
|
 |
arargh307NOS.. #11 / 20
|
 syntax problem in quickbasic
Quote:
>> >Dooley and frinds thank you it works ,my new problem is that is not read the >> <snip> >> >i get error >> >didnt find 9 numbers parsing the o >> >following data line >> >0.5 .97 -20 5.68 162 .023 76 .47 -11 >> >what is wrong in the code? >> Where is the code? >> <snip> >The code is in the first message
Oh. Ok, I will look at it later today. -- Arargh307 at [drop the 'http://www.' from ->] http://www.arargh.com BCET Basic Compiler Page: http://www.arargh.com/basic/index.html To reply by email, remove the garbage from the reply address.
|
Sun, 15 Jan 2006 17:25:30 GMT |
|
 |
yehonat #12 / 20
|
 syntax problem in quickbasic
I don't understand the syntex of this line,if some body can help me (what is the meaning of IF [] THEN [] :[] :[] form) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ IF CH$=""AND SP=0 THEN D(k)=VAL(D$): k=k+1:SP=1:D$="" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Quote:
> the word screen in the second line was a carry over from the upper remark > statement
> > this works just fine, with more than one line in the if loop > > cls 'to clear previous test > > screen > > c$ = "shit.s2p" 'test c$ I made up > > test$ = right$(c$,4) 'made up string to test > > if ucase$(test$) =".S2P" then 'test string > > ufn$ = left$(cs, len(c$) - 4) 'assign value to ufn$ > > Print ufn$ 'print value > > End if 'end if loop
> > > > > -> >I still have the same problem > > > > > -> >"type mismatch ;eorr code :13 > > > > > -> >for the code : > > > > > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ > found. > > > > > -> Try: > > > > > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. > > > > > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) > > > > > It's worth noting that strange things sometimes happen if a comment > is > > > > > put immediately after THEN. BASIC checks IF statements to see if > they > > > > > are the one-line variety e.g.: > > > > > IF X = 1 THEN PRINT "One" > > > > > or the multi-line kind: > > > > > IF X = 1 THEN > > > > > PRINT "One" > > > > > END IF > > > > > If any code follows the word THEN, BASIC assumes that a one-line IF > is > > > > > involved. A comment can be seen as code, causing things to go wrong. > > > > > This shouldn't happen if there is at least one space between the > THEN > > > > > and the comment, but it's easy to forget to include this space. > > > > > dow > > > > BS Never (20+ years) had a problwm with a comment after a THEN > > > Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need > > > more experience. > > > MCM
|
Sun, 15 Jan 2006 17:46:32 GMT |
|
 |
arargh307NOS.. #13 / 20
|
 syntax problem in quickbasic
Quote:
>> the word screen in the second line was a carry over from the upper remark >> statement
>> > this works just fine, with more than one line in the if loop >> > cls 'to clear previous test >> > screen >> > c$ = "shit.s2p" 'test c$ I made up >> > test$ = right$(c$,4) 'made up string to test >> > if ucase$(test$) =".S2P" then 'test string >> > ufn$ = left$(cs, len(c$) - 4) 'assign value to ufn$ >> > Print ufn$ 'print value >> > End if 'end if loop
>> > > > > -> >I still have the same problem >> > > > > -> >"type mismatch ;eorr code :13 >> > > > > -> >for the code : >> > > > > -> >IF UCASE$(RIGHT$(C$, 4) = ".S2P") THEN 'Plausible command$ >> found. >> > > > > -> Try: >> > > > > -> IF UCASE$(RIGHT$(C$, 4)) = ".S2P" THEN 'Plausible command$ found. >> > > > > -> >ufn$ = LEFT$(C$, LEN(C$) - 4) >> > > > > It's worth noting that strange things sometimes happen if a comment >> is >> > > > > put immediately after THEN. BASIC checks IF statements to see if >> they >> > > > > are the one-line variety e.g.: >> > > > > IF X = 1 THEN PRINT "One" >> > > > > or the multi-line kind: >> > > > > IF X = 1 THEN >> > > > > PRINT "One" >> > > > > END IF >> > > > > If any code follows the word THEN, BASIC assumes that a one-line IF >> is >> > > > > involved. A comment can be seen as code, causing things to go wrong. >> > > > > This shouldn't happen if there is at least one space between the >> THEN >> > > > > and the comment, but it's easy to forget to include this space. >> > > > > dow >> > > > BS Never (20+ years) had a problwm with a comment after a THEN >> > > Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need >> > > more experience. >> > > MCM >I don't understand the syntex of this line,if some body can help me >(what is the meaning of IF [] THEN [] :[] :[] form) >++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >IF CH$=""AND SP=0 THEN D(k)=VAL(D$): k=k+1:SP=1:D$="" >++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Same as this IF CH$="" AND SP=0 THEN D(k)=VAL(D$) k=k+1 SP=1 D$="" ENDIF but in a more compact form
And don't top post. -- Arargh307 at [drop the 'http://www.' from ->] http://www.arargh.com BCET Basic Compiler Page: http://www.arargh.com/basic/index.html To reply by email, remove the garbage from the reply address.
|
Sun, 15 Jan 2006 17:51:43 GMT |
|
 |
Michael Mattia #14 / 20
|
 syntax problem in quickbasic
Quote:
> > Nor have I. But I've used BASICs 'only' about 15 years, so maybe I need > > more experience. > > MCM > You still have much hair?
Judge for yourself. There's a picture on my web site at http://www.talsystems.com (You have to click an extra time to "enter Tal Systems' site") Hit "about us." Not just a pic, but a whole page of shameless self-serving promotion. -- Michael Mattias Tal Systems, Inc. Racine WI
|
Sun, 15 Jan 2006 18:45:12 GMT |
|
 |
Phre #15 / 20
|
 syntax problem in quickbasic
[...] Quote:
>> the word screen in the second line was a carry over from the upper remark >> statement
>> > this works just fine, with more than one line in the if loop >> > cls 'to clear previous test >> > screen >> > c$ = "shit.s2p" 'test c$ I made up >> > test$ = right$(c$,4) 'made up string to test >> > if ucase$(test$) =".S2P" then 'test string >> > ufn$ = left$(cs, len(c$) - 4) 'assign value to ufn$ >> > Print ufn$ 'print value >> > End if 'end if loop
I find it difficult to believe that code "works just fine". Now, if that "cs" in the 6th line was "c$" then perhaps ... Cheers, Phred. --
|
Sun, 15 Jan 2006 21:18:05 GMT |
|
|
Page 1 of 2
|
[ 20 post ] |
|
Go to page:
[1]
[2] |
|