Jump to content
IGNORED

Hashtag-Parameters in SUB


SteveB

Recommended Posts

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?

Link to comment
Share on other sites

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.

 

      image.png.57adda560f77f7e771cb3eb07f342c13.png

will finally become

     image.png.a25287d434088b6f125ea6534b9049c6.png 

as expected.

 

 

 

 

Edited by SteveB
  • Like 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...