Design Scripting Documentation
     
 
     
  Generic variable conversion to string  
     
     
  Inputs:  
     
any variable
     
  Outputs:  
     
a string representation
     
  Remarks:  
     
this function is like php's var_dump. It dumps a
any kind of variable in a string format. There are
a couple of limitations about the data types, such
multidimensional arrays (but not jagged arrays) and
objects (since there is not default toString( ) in vbs).
     
  Implementation
01  function convert( variable )
02    select case vartype( variable )
03      case vbempty:      convert = "[empty]"
04      case vbnull:       convert = "[null]"
05      case vbinteger:    convert = cstr( variable )
06      case vblong:       convert = cstr( variable )
07      case vbsingle:     convert = formatnumber( variable, 2 )
08      case vbdouble:     convert = formatnumber( variable, 2 )
09      case vbcurrency:   convert = cstr( variable )
10      case vbdate:       convert = cstr( variable )
11      case vbstring:     convert = variable
12      case vbobject:     convert = "[object]"
13      case vberror:      convert = "[error]"
14      case vbboolean:    convert = cstr( variable )
15      case vbbyte:       convert = cstr( variable )
16      case vbdataobject: convert = "[dataobject]"
17      case else:         convert = array_convert( variable )
18    end select
19  end function
 
     

Creative Commons License
The Design Scripting Library, including its sources, online documentation and graphics, are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Online Documentation generated by { vbdoclib } version 1.0
Color-Coding generated by { vbcc } version 2.0
Page timestamp: { Feb. 2, 2006 }





 
     
     
 
Documentation
Cover Page
Expand
Collapse
 
Array
 
Bitmap File
 
Bounding Box
 
Color
 
Container
 
Doclet
 
Ellipse
 
Intersection
 
Language
 
Map
 
Matrix
 
Number
 
Nurbs
 
Range
 
STL File
 
Streams
 
String
 
Surface
 
Text File
 
Triangle
 
Vector
 
Vertex
 
Wave File