Προς το περιεχόμενο

Η_str_Στην_ Pascal;


temeteron

Προτεινόμενες αναρτήσεις

Δημοσ.

Str Procedure

 

Syntax: Str(number, mystr)

where number is a numeric data type and

mystr is a string identifier

 

Str is used to convert an integer, real, etc. into a string. This procedure has little utility. It is provided basically to mirror/reverse the effect of the procedure Val. Given the following declarations and assignments, several things are possible.

 

num_int : integer;

num_real : real;

mystr : string;

 

num_int := 345;

num_real := 34.567;

 

* The following code would result in mystr containing '345'.

 

Str(num_int, mystr)

 

* The following code would result in mystr containing ' 345', with two leading spaces.

 

Str(num_int:5, mystr)

 

* The following code would result in mystr containing '34.57'.

 

Str(num_real:1:2, mystr)

 

* The following code would result in mystr containing ' 34.6', with three leading spaces.

 

Str(num_real:7:1, mystr)

 

 

Ψάξε ρε μάστορα στο Google ....

Θα βρέις ότι θες!!!!

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...