Jump to content
Sign in to follow this  
c58_4311

Problem In Passing String Variable In Procedure Call

Recommended Posts

There seams to be some problem in latest version (6.85) of boostbasic when passing string variables in procedures:

 

 

'code 0

sub print(a as string)

...

...

...

end sub

When we assign any string value to the 'a' variable, like

 

print("hello")

 

The value passed to variable 'a' get corrupted.

 

 

but if we modify the above code into following, we get correct results

 

'code 1

sub print(a as string)

...

...

...

end sub

 

 

dim x as string(10)

x = "hello"

print(x)

 

 

The Code 0 and Code 1, both worked correctly in the perevious version (6.84) of boostbasic.

Share this post


Link to post
Share on other sites

This is bug in your code. You need to use string length in function/subroutine arguments too. Change your print declaration to:

 

sub print( a as string(10) )
...
...
...
end sub

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. 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...
Sign in to follow this  

×
×
  • Create New...