Wide Studio Object Reference

Wide Studio Home
Up to

## Class Name

WSCvariant

## Specification of methods

### getChar method

Form
  char getChar()
Function
  Returns the value of type: char.
Description
Parameters
  None.
Return value
  Returns the value of type: char.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        char val = variant.getChar();

### getUnsignedChar method

Form
  WSCuchar getUnsignedChar()
Function
  Returns the value of type: unsigned char.
Description
Parameters
  None.
Return value
  Returns the value of type: unsigned char.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        WSCuchar val = variant.getUnsignedChar();

### getShort method

Form
  short getShort()
Function
  Returns the value of type: short.
Description
Parameters
  None.
Return value
  Returns the value of type: short.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        short val = variant.getShort();

### getUnsignedShort method

Form
  WSCushort getUnsignedShort()
Function
  Returns the value of type: unsigned short.
Description
Parameters
  None.
Return value
  Returns the value of type: unsigned short.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        WSCushort val = variant.getUnsignedShort();

### getLong method

Form
  long getLong()
Function
  Returns the value of type: long.
Description
Parameters
  None.
Return value
  Returns the value of type: long.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        long val = variant.getLong();

### getUnsignedLong method

Form
  WSCulong getUnsignedLong()
Function
  Returns the value of type: unsigned long.
Description
Parameters
  None.
Return value
  Returns the value of type: unsigned long.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        WSCulong val = variant.getUnsignedLong();

### getInt method

Form
  int getInt()
Function
  Returns the value of type: int.
Description
Parameters
  None.
Return value
  Returns the value of type: int.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        int val = variant.getInt();

### getUnsignedInt method

Form
  WSCuint getUnsignedInt()
Function
  Returns the value of type: unsigned int.
Description
Parameters
  None.
Return value
  Returns the value of type: unsigned int.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        WSCuint val = variant.getUnsignedInt();

### getVoidPtr method

Form
  void* getVoidPtr()
Function
  Returns the value of type: void pointer.
Description
Parameters
  None.
Return value
  Returns the value of type: void*.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        void* ptr = variant.getVoidPtr();

### getCharPtr method

Form
  char* getCharPtr()
Function
  Returns the value of type: char pointer.
Description
Parameters
  None.
Return value
  Returns the value of type: char*.
Notice
  Do not delete the return value.
Samples

        WSCvariant variant;
        variant = 100;
        char* ptr = variant.getCharPtr(); //Returns string ptr: "100".

### getFloat method

Form
  float getFloat()
Function
  Return the value of type: float.
Description
Parameters
  None.
Return value
  Return the value of type: float.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        float val = variant.getFloat(); //Returns float value: 100.0

### getDouble method

Form
  double getDouble()
Function
  Return the value of type: double.
Description
Parameters
  None.
Return value
  Return the value of type: double.
Notice
Samples

        WSCvariant variant;
        variant = 100;
        double val = variant.getDouble(); //Returns double value: 100.0

### setValue method

Form
  void setValue(TYPE val)
Function
  Sets the value.
  You can pass a value of TYPE: char,WSCuchar,short,WSCushort,long,WSCulong, int,WSCuint,char*,void*,float,double.
Description
Parameters

  (in)TYPE val | A value

Return value
  None.
Notice
Samples

        WSCvariant variant;
        //set value (int)100.
        variant.setValue(100);
        printf("val=%s\n",(char*)variant); // Returns string ptr: "100"
        printf("val=%d\n",(long)variant); // Returns long value: 100

  ### WSCvariant method

  Form
    WSCvariant(TYPE val)
  Function
    This is the constructor with an initial value.
    You can pass a value of TYPE:char,WSCuchar,short,WSCushort,long,WSCulong, int,WSCuint,char*,void*,float,double.
  Description
  Parameters

    (in)TYPE val | A value

  Return value
    None.
  Samples

          WSCvariant variant(100);
          printf("val=%s\n",(char*)variant); // Returns string ptr: "100"
          printf("val=%d\n",(long)variant); // Returns long value: 100

  Notice

  ### operator = method

  Form
    WSCvariant& operator = (TYPE)
  Function
    Substitutes the specified value of TYPE to the instance.
    You can specify TYPE: char,WSCuchar,short,WSCushort,long, WSCulong,int,WSCuint,char*,void*,float,double.
  Description
  Parameters
  Return value
    None.
  Notice
  Samples
    Refer to setLong().

  ### getType method

  Form
    long getType()
  Function
    Returns the identifier of the containd data type.
  Description
  Parameters
    None.
  Return value
    Identifier

    WSTlong | long
    WSTulong | unsinged long
    WSTint | int
    WSTuint | unsigned int
    WSTshort | short
    WSTushort | unsigned short
    WSTchar | char
    WSTuchar | unsigned char
    WSTfloat | float
    WSTdouble | double
    WSTvoidptr | voidptr
    WSTcharptr | charptr
    WSTvoid | void
    WSTbool | bool

  Notice
  Samples

          WSCvariant variant(100);
          long type = variant.getType();

  ### getTypeName method

  Form
    char* getTypeName()
  Function
    Returns the type name of the contained data type.
  Description
  Parameters
    None.
  Return value
    the type name.
  Notice
  Samples

          WSCvariant variant(100);
          char* typename = variant.getTypeName();

  ### clear method

  Form
    void clear()
  Function
    clear the contained data.
  Description
  Parameters
    None.
  Return value
    None.
  Notice
  Samples

          WSCvariant variant(100);
          //clear the data and assume the value 100 to 0.
          variant.clear();

  Document Release 3.70
  For use with Wide Studio Release 3.70, Spring 2004

  Wide Studio Home | Up to

  Copyright(C) WideStudio Development Team, 1999-2004 |  | Last modified: May 25, 2004