Author Topic: can user created qbasic functions return a string?  (Read 1954 times)

0 Members and 1 Guest are viewing this topic.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
can user created qbasic functions return a string?
« on: July 21, 2018, 10:49:32 pm »
Code: QB64: [Select]
  1. FUNCTION QUAD_NAME (X, Y, Z AS INTEGER)  
  2. QUAD_NAME = string_var
  3.  
returns a "illegal string-number conversion"

I checked the in IDE help on function command(currently using QB64, but their wiki is down), but no information as to whether it can return a string. currently I am using a global var to assign the quad_name but would prefer to use a function to return the desired var.

thanks for helping
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline Gets

  • Newbie
  • Posts: 28
Re: can user created qbasic functions return a string?
« Reply #1 on: July 21, 2018, 11:12:55 pm »
Rename it QUAD_NAME$


Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
Re: can user created qbasic functions return a string?
« Reply #2 on: July 22, 2018, 12:05:55 am »
oops got it

Changing both the function var and the return far with a "$" did the trick



thanks again!

« Last Edit: July 22, 2018, 12:14:59 am by xra7en »
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!