Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 14:46 16 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 correct use of string$() function...???

Author Message
johngill
Newbie

Joined: 22/09/2020
Location: United Kingdom
Posts: 38
Posted: 12:07pm 17 Nov 2020
Copy link to clipboard 
Print this post

Hi all,

I think there might be a bug in the string$ function - or I'm being a numpty, which is equally plausible.

Typing in:
print string$(1,35)

it displays:
#

Which is correct, # is the character that has ascii value 35.

But typing in:
let a = 35
print string$(1,a)

if gives me an error - "Expected a string"

Any ideas what's going on?

thanks

John
 
johnd
Newbie

Joined: 22/10/2020
Location: United States
Posts: 30
Posted: 12:15pm 17 Nov 2020
Copy link to clipboard 
Print this post

Yeah, this looks like a bug.  A work around would be:

let a$ = chr$(35)
print string$(1,a$)

or

print string$(1,chr$(35))

Cheers
Edited 2020-11-17 22:16 by johnd
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10588
Posted: 12:37pm 17 Nov 2020
Copy link to clipboard 
Print this post

Not a bug but perhaps the manual could be clearer

The value can either be an ascii literal (not a variable) or a string which can be a variable
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025