fbpx

? <output>

  • Karl-Heinz Rauscher
  • Karl-Heinz Rauscher's Avatar Topic Author
  • Offline
More
4 months 3 weeks ago #1 by Karl-Heinz Rauscher
? <output> was created by Karl-Heinz Rauscher
Hi Robert,

This works the same way as it does with VO

? <xExp1> , <xExp2> , <...>

Some time ago i´ve noticed that with X# this is also possible:

? <xExp1> + " " + <xExp2> + " " + <...>

My question: is the second way restricted ? I´m asking because i´ve noticed that there are several problems when VO specific types are involved.

regards
Karl-Heinz

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #2 by Robert van der Hulst
Replied by Robert van der Hulst on topic ? <output>
Karl Heinz,
The second method uses the built-in mechanism of .Net that every type has a ToString() method. I am not sure which problem you are seeing. Maybe one of the built-in types needs a better ToString() ?

Robert

XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

  • Karl-Heinz Rauscher
  • Karl-Heinz Rauscher's Avatar Topic Author
  • Offline
More
4 months 3 weeks ago #3 by Karl-Heinz Rauscher
Replied by Karl-Heinz Rauscher on topic ? <output>
Hi Robert,

yes, something like

? eval ( cb , 5 ):Tostring()
? fValue:Tostring()

does not cause any problems, but the code below throws several runtime errors when VO specific types are involved.

FUNCTION DoOutPut() AS VOID 

  LOCAL fValue AS FLOAT
  LOCAL a AS ARRAY
  LOCAL cb AS CODEBLOCK 
  LOCAL u AS USUAL



   fValue := 12.23

   cb := {| n | n + 1  }

   a := { "one" , "two" }

   u := 12333

   

   //  If the very first expression result is a VO type:

   //  "incompatible argument" runtime error 
       
	
    ?  today()  + "  " + setcentury()     //  <-----


    //  "out of range" runtime error  

    ?  a [ 1 ] + " " + setcentury()   //  <-----


    //  ------------

    // If the very first result is not a VO specific type it runs. 

     ? SetCentury()  + " " + today() 


     ? setcentury() + " " + a [ 1 ] 


     ?  _chr(9) + today()       
  
     ? space(20) + today()  

 
   // But floats, usuals and codeblocks throw runtime errors,
   // no matter if they are positioned at second pos.
       
      // "argument is not numeric"
     ? setcentury()  + " " + fValue     //  <----- 
       
      //  "out of range" 
     ? setcentury() + "  " + eval ( cb , 5 )   //  <-----	
	 
      //  "out of range" 
	     
       ? setcentury() + " " + u   //  <-----	
	 
       ?
	 
	
	
	RETURN


regards
Karl-Heinz

Please Log in or Create an account to join the conversation.