[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference marin::forte-ft

Title:Forte' Field Test Conference
Notice:Forte R3 is due in summer...with lots of NEW features
Moderator:MARIN::ARVIND
Created:Wed Aug 04 1993
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:919
Total number of notes:3356

904.0. "BinaryData conversion problem" by MLNAD0::ALLIEVI () Wed Feb 19 1997 02:44

Hello,

	We are using Forte V2.0.

	We are reading a binary file and we are trying to understand how to 
convert BinaryData into TextData and DoubleData.

Any idea on how to do it ?

Thank you in advance and best regards.

	Mario and Anna

T.RTitleUserPersonal
Name
DateLines
904.1Some waysNSIC00::KLERKThunderbirds are GoThu Feb 20 1997 00:2618

  One way of going from integer to text:
  
  intInteger : Integer = 5;
  txtNumber  : TextData;
  // fill strNumber with string '5'
  txtNumber.ReplaceParameters(source= %1 ,
               parameter1=IntegerData(value = intInteger));

  or going from IntegerData to TextData:

  intNumber : IntegerData = new (value = 5);
  txtNumber.SetValue(intNumber.TextValue);


  Theo
   
904.2Binary DataMLNAD0::ALLIEVITue Feb 25 1997 08:1313
    
    Thank you for the answer but it's not what we are looking for.
    
    We need to convert Binary Data into Text Data
    
    Thank you.
    
    We hope you can help us.
    
    Best Regards
    		
    	Mario e Anna
    
904.3ExampleMARIN::ARVINDFix BUGS.. Call BUGS BunnyTue Feb 25 1997 16:0818
    Given below is an example which reads an imagefile into 
    imagedata and then to BinaryData and finally to TextData.
    
    Hope it helps!
    
    Arvind
    
    imgfile : File = new;
    img : ImageData = new;
    binimg : binaryData = new;
    imgfile.SetPortableName('%{FORTE_ROOT}/install/examples/images');
    imgfile.AddTopath('mona.bmp');
    img.ReadFromFile(imgfile);
    binimg.SetValue(img);
    binimgtxt : TextData = new;
    binimgtxt = binimg.TextValue;
    task.part.logmgr.Putline(binimgtxt);