March 29, 2024, 07:37:50 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Question? is there a way to pass an Istring to a method of a CLASS?

Started by Pewing, April 20, 2009, 08:03:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pewing

When I try and pass an Istring parm to a method of a class, I get the "No appropriate conversion exist" error.  I thought version 1.7 allowed for this.
example:
CLASS Istr
   DEF anIstring [3000] as istring
   DECLAIRE SetIstr (arg [3000]:istring)
ENDCLASS

SUB Istr::SetIsrt (arg [3000]:istring)
   anIstring = srg
ENDSUB

$MAIN
  DEF Myobj as istr
  DEF Test [3000] as Istring
  test = assgn_it
  Myobj.SetIstr(test)  <-- Error
END

This is cramping my style, if you know what I mean

Peter
"I hit the ESC key , so why am i still here?"

Ionic Wind Support Team

Just use the string type as the parameter, in this case it is interchangeable as all strings are passed by reference.

CLASS Istr
   DEF anIstring [3000] as istring
   DECLARE SetIstr (string arg)
ENDCLASS


SUB Istr::SetIsrt (string arg)
   anIstring = srg
ENDSUB

Paul.
Ionic Wind Support Team

Pewing

Thanks, I also just discovered that if I send the paramater with a [ 0 ] element that seems to also work. I guess the compiler needed the first element to get the reference address. exp:  Myobj.SetIstr(test [ 0 ]) 

Allan