SteveB Posted September 14, 2021 Share Posted September 14, 2021 Hi, Extended BASIC uses # for sprite- and file-numbers, like CALL MOTION(#1,16,0). I have build a subroutine for a sprite with XB256 and it feels somehow wrong to use just the sprite-number without a #. SUB SPEED(S,X,Y) CALL VREAD(1920,112,A$) X = ASC(SEG$(A$,S*4-3,1)) IF X>127 THEN X=X-256 Y = ASC(SEG$(A$,S*4-2,1)) IF Y>127 THEN Y=Y-256 SUBEND With CALL SPEED(1,X,Y) I can read the speed of of sprite #1. It would look better and more consistent if I could use CALL SPEED(#1,X,Y) instead, but this gives me a syntax error, no matter how I try to define the SUB. [The CALL VREAD() will be replaced with CALL LINK("VREAD",1920,112,A$) by SXB in this example if you want to use the routine in standard XB/XB256] Any ideas? Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted September 14, 2021 Share Posted September 14, 2021 XB can pass numeric and string variables or constants to an assembly sub. Here is the problem: #1 is not a number "#1" is a string and could be passed, but then you need the quotes. I could never see a way around this. Quote Link to comment Share on other sites More sharing options...
RXB Posted September 14, 2021 Share Posted September 14, 2021 I have been working on the source code of XB GPL and Assembly longer then probably than anyone else as it is my sole project. Why they picked the # symbol to put in Sprite routine is a mystery for me too. Quote Link to comment Share on other sites More sharing options...
SteveB Posted September 14, 2021 Author Share Posted September 14, 2021 (edited) I consider these definitive answers, thank you both! I kind of like the #1, but the # gave me hell for the syntax-highlighter in TiCodEd. But I finally managed to apapt it for the next version I am currently working on. It was interpreted as I don't know what until the end of the line. will finally become as expected. Edited September 14, 2021 by SteveB 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.