Blame view

src/idl_misc/JPBLib_for_Dustemwrap/General/value2string.pro 1.05 KB
6db3528a   Jean-Philippe Bernard   adding librairies...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FUNCTION value2string,value

;Returns a string corresponding to the type of value
  
vv=value
sst=size(value,/str)
  
;si=size(value)
;IF n_elements(si) NE 3 THEN vv=value(0)
;si=size(vv)

numb = 1
;CASE si(1) OF
CASE sst.type OF
  1:BEGIN
    string='0B'
  END
  2:BEGIN
    string='0'
  END
  3:BEGIN
    string='0L'
  END
  4:BEGIN
;    string='0.'
    string=''
  END
   5:BEGIN
;    string='0.D0'
    string='0D0'
  END
  6:BEGIN
    string='complex(0,0)'
    numb=0
  END
  7:BEGIN
    string="'"
    numb=2
  END
  8:BEGIN
    string='{aa:0}'
    numb=0
  END  
  9:BEGIN
    string='dcomplex(0,0)'
    numb=0
  END
  10:BEGIN
    string='ptr_new()'
    numb=0
  END
  11:BEGIN
    string='obj_new()'
    numb=0
  END
  12:BEGIN
    string='0U'
  END
  13:BEGIN
    string='0UL'
  END
  14:BEGIN
    string='0LL'
  END
  15:BEGIN
    string='0ULL'
  END
ENDCASE

;RETURN,string
CASE numb OF
  0: BEGIN
    RETURN,string
  END
  1: BEGIN
    RETURN,strtrim(value,2)+strmid(string,1,1000)
  END
  2: BEGIN
    RETURN,string+strtrim(value,2)+string
  END
ENDCASE

END