Re: [xHarbour-developers] Another one
Il 18/08/2016 01:17, Ron Pinkas ha scritto: >> Do you mean this way? >> >> MYSAY ROW 12 COL 0 ( &( "cVar" + LTRIM( STR( n ) ) ) ) >> >> I get: >> >> Error E0030 Syntax error: "syntax error at '(‘" > > Strange, I believed it should have worked. I must be missing something or it > might be some PP bug. Anyway the best approach is the solution above. Ok, thank you. EMG -- EMAG Software Homepage: http://www.emagsoftware.it The EMG Music page: http://www.emagsoftware.it/emgmusic The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum The Best of Spectrum Games: http://www.emagsoftware.it/tbosg -- ___ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers
Re: [xHarbour-developers] Another one
>> Simply avoiding the ambiguity, either by changing the line to : >> >>MYSAY … ROW … COL … >> >> Note the ORDER! > > Ok, this way: > > MYSAY &( "cVar" + LTRIM( STR( n ) ) ) ROW 12 COL 0 Yes. >> Also you can so round the & exp with () this too will remove the ambiguity. > > Do you mean this way? > > MYSAY ROW 12 COL 0 ( &( "cVar" + LTRIM( STR( n ) ) ) ) > > I get: > > Error E0030 Syntax error: "syntax error at '(‘" Strange, I believed it should have worked. I must be missing something or it might be some PP bug. Anyway the best approach is the solution above. Ron -- ___ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers
Re: [xHarbour-developers] Another one
Il 17/08/2016 19:38, Ron Pinkas ha scritto: > Simply avoiding the ambiguity, either by changing the line to : > > MYSAY … ROW … COL … > > Note the ORDER! Ok, this way: MYSAY &( "cVar" + LTRIM( STR( n ) ) ) ROW 12 COL 0 > Also you can so round the & exp with () this too will remove the ambiguity. Do you mean this way? MYSAY ROW 12 COL 0 ( &( "cVar" + LTRIM( STR( n ) ) ) ) I get: Error E0030 Syntax error: "syntax error at '('" EMG -- EMAG Software Homepage: http://www.emagsoftware.it The EMG Music page: http://www.emagsoftware.it/emgmusic The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum The Best of Spectrum Games: http://www.emagsoftware.it/tbosg -- ___ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers
Re: [xHarbour-developers] Another one
Il 16/08/2016 19:19, Ron Pinkas ha scritto: >> MYSAY ROW 12 COL 0 &( "cVar" + LTRIM( STR( n ) ) ) > > Because: > > 0 & … > > Is a valid single expression! Ahh! I really missed it! So what is the proper solution? A change in this command definition? #command MYSAY []; [ROW ]; [COL ]; => MySayText( , , ) Or the prefix "" + that I already adopted? EMG -- EMAG Software Homepage: http://www.emagsoftware.it The EMG Music page: http://www.emagsoftware.it/emgmusic The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum The Best of Spectrum Games: http://www.emagsoftware.it/tbosg -- ___ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers
Re: [xHarbour-developers] Another one
Il 16/08/2016 18:50, Ron Pinkas ha scritto: >> #command MYSAY []; >>[ROW ]; >>[COL ]; >> => MySayText( , , ) >> >> >> FUNCTION MAIN() >> >> PRIVATE cVar1 := "This is a test" >> >> PRIVATE n := 1 >> >> CLS >> >> @ 8, 0 SAY &( "cVar" + LTRIM( STR( n ) ) ) >> >> MYSAY ROW 10 COL 0 "" + &( "cVar" + LTRIM( STR( n ) ) ) >> >> // This SAY won't show >> MYSAY ROW 12 COL 0 &( "cVar" + LTRIM( STR( n ) ) ) >> >> INKEY( 0 ) >> >> RETURN NIL >> >> >> FUNCTION MYSAYTEXT( cTxt, nRow, nCol ) >> >> @ nRow, nCol SAY cTxt >> >> RETURN NIL > > If you check the .PPO you will understand that you have a Pre Processing > issue, with your command. Yes, but please note that this works: MYSAY ROW 10 COL 0 "" + &( "cVar" + LTRIM( STR( n ) ) ) while this don't: MYSAY ROW 12 COL 0 &( "cVar" + LTRIM( STR( n ) ) ) The only difference is: "" + I don't understand why. Can you explain, please? EMG -- EMAG Software Homepage: http://www.emagsoftware.it The EMG Music page: http://www.emagsoftware.it/emgmusic The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum The Best of Spectrum Games: http://www.emagsoftware.it/tbosg -- ___ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers
Re: [xHarbour-developers] Another one
If you check the .PPO you will understand that you have a Pre Processing issue, with your command. > On Aug 16, 2016, at 9:26 AM, Enrico Maria Giordano > wrote: > > #command MYSAY []; >[ROW ]; >[COL ]; > => MySayText( , , ) > > > FUNCTION MAIN() > > PRIVATE cVar1 := "This is a test" > > PRIVATE n := 1 > > CLS > > @ 8, 0 SAY &( "cVar" + LTRIM( STR( n ) ) ) > > MYSAY ROW 10 COL 0 "" + &( "cVar" + LTRIM( STR( n ) ) ) > > // This SAY won't show > MYSAY ROW 12 COL 0 &( "cVar" + LTRIM( STR( n ) ) ) > > INKEY( 0 ) > > RETURN NIL > > > FUNCTION MYSAYTEXT( cTxt, nRow, nCol ) > > @ nRow, nCol SAY cTxt > > RETURN NIL -- ___ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers
[xHarbour-developers] Another one
#command MYSAY []; [ROW ]; [COL ]; => MySayText( , , ) FUNCTION MAIN() PRIVATE cVar1 := "This is a test" PRIVATE n := 1 CLS @ 8, 0 SAY &( "cVar" + LTRIM( STR( n ) ) ) MYSAY ROW 10 COL 0 "" + &( "cVar" + LTRIM( STR( n ) ) ) // This SAY won't show MYSAY ROW 12 COL 0 &( "cVar" + LTRIM( STR( n ) ) ) INKEY( 0 ) RETURN NIL FUNCTION MYSAYTEXT( cTxt, nRow, nCol ) @ nRow, nCol SAY cTxt RETURN NIL Result: This is a test This is a test NIL EMG -- EMAG Software Homepage: http://www.emagsoftware.it The EMG Music page: http://www.emagsoftware.it/emgmusic The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum The Best of Spectrum Games: http://www.emagsoftware.it/tbosg -- ___ xHarbour-developers mailing list xHarbour-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xharbour-developers