링크 ux 는 시간 형식 값 을 수치 형 으로 변환 합 니 다.

          :                      ,         .
1. :
:substr(c,n1,n2)
: C n1 n2 . .
: .
store " " to xm
?substr(xm,1,2)
:
2. : 3 ,3 .
trim( ):
alltrim( ):
ltrim( ):
:
store "abcd " to x
store "efg" to y
?trim(x)+y
abcdefg
3. :
:space(n)
: (n ).
: dh, 8
store space(8) to dh
4. :
:left(c,n)
: C n .
5. :
:right(c,n)
: c n
:a=" "
?right(a,4)

?left(a,2)

6.empty(c): C .
7. :
:At( 1, 2)
: 1 2
:?At(" "," ")
2
8. :
:
lower( )
upper( )
:lower() ;upper()
:
bl="FoxBASE"
?lower(bl)+space(2)+upper(bl)
foxbase FOXBASE
9. :
:len( )
:
:a=" "
?len(a)
6
. :
1. :
:int( )
: .
:
?int(25.69)
25
2. :
:round( , )
: ,
:
?round(3.14159,4),round(2048.9962,0),round(2048.9962,-3)
3.1416 2049 2000
3. :
:sqrt( )
:
:?sqrt(100)
10
4. 、 :

Max( 1, 2)
Min( 1, 2)


x1=123.456
x2=234.567
?max(x1,x2)
234.567
?min(x1,x2)
123.456
5. :
:mod( 1, 2)
: 1 2

?mod(10,3)
1
6. 、 :
:
exp( )
log( )
:
(1).exp() e ,
(2).log() , lnx .
:
x=1
y=exp(x)
?exp(x),log(x)
2.72 1
. :
1. :
:str(n,n1,n2)
: n ,n1 ,n2
:?str(321.56)
322
?str(321.56,6,2)
321.56
2. :
:val(s)
: s
:x="23"
y="76"
?val(x)+val(y)
100
3. :
:ctod(c)
: c
:set date ansi
?ctod("^2005.11.14")
2005.11.14
4. :
:dtoc(d)
: d
: .
set century on , 4
set date ansi
rq={^2005.11.14}
rq=dtoc(rq)
?substr(rq,1,4)+" "+substr(rq,6,2)+" "+substr(rq,9,2)+" "
2005 11 14
5. :
:ttoc( )
:
6. :
:ctot(c)
:
7. :
:stuff( 1, , , 2)
: , 2 1 . , ; 2 , 1 .
:X=" !"
?stuff(X,7,4," ")

?stuff(X,11,0," ")

?stuff(x,7,4," ")

8. ASCⅡ :
:Asc( )
: ASCⅡ
:x="Foxpro"
?Asc(x),Asc(lower(x))
70 102
9.ASCⅡ :
:chr( )
: ASCⅡ ,
:?chr(70)+chr(111)+chr(111+9)
Fox
. :
1. :
:date()
: , .
:
?date()
11/14/05
set date ansi
set century on
?date()
2005.11.14
2. 、 、 :
:(1).year( ): .
(2).month( ): .
(3).day( ): .
:
rq=date()
?year(rq),month(rq),day(rq)
2005 11 14
3. :
:time()
:
:?time()
20:32:26
4. :
:datetime()
:
:?datetime()
2005.11.14 08:35:12 PM
5. :
:dow( )
cdow( )
:dow ,1 ,7 ;cdow
:?date()
2005.11.15
?dow(date()),cdow(date())
3 Tuesday
. :
1. :
:eof([n])
:
(1).n , 1~32767
(2). , ; ; .
:
use
go bottom
?eof()
.F.
skip
?eof()
.T.
2. :
:bof([n])
:
(1).n , 1~32767
(2). , ; ; .
:
use
go top
?bof()
.f.
skip -1
?bof()
.t.
3. :
:recno()
:
:
use
?recno()
1
skip
?recno()
2
4. :
:reccount()
:
: " "
use
?reccount()
5
5. :
:fcount()
:
: " "
use
?fcount()
9
6. :
:found()
: find、seek locate . , .
: " " " "
use
locate for =" "
?found()
.t.
display
7. :
:file( )
:
:?file("e:\myvfp\ .dbf")
.t.
8. :
:type( )
: , :N( )、C( )、L( )、D( )、M( )

x=1236
y="hello"
?type("x")
N
?type("y")
C
9. :
:select()
:
10. :
:alias()
:
:
select 1
use alias zgda
select 2
use
?alias()
, ,
select zgda
?select()
1
11. :
:dbf()
:
:
use
?dbf()
e:\myvfp\
. :
1. :
:
:vfp . .
: " " 100
gz=" "
use
replace all gz with gz+100
2. :
:iif( , 1, 2)
: , 1 ; 2 ; 1 2
a=3
b=5
?iif(ab," "," ")

3. :
:messagebox( [, [, ]])
:
:
(1) :

0 " "
1 " " " "
2 " "," " " "
3 " "," " " "
4 " " " "
5 " " " "
16 stop
32 ?
48 !
64 i
0 1
256 2
512 3
(2). :

1
2
3
4
5
6
7
: messagebox(" ?",4+64," ") .
: , " ", " ",
"4+64", 4 " " " " ( 1),64 i ( 2)
ok, :
tui=messagebox(" ?",4+64," ")
tui messagebox , 1
?tui
tui , " ", 6, " ", 7, 2
: , " " :
tui=messagebox(" ?",4+64," ")
if tui=6 , " " , quit ,
quit
endif

다음으로 전송:https://www.cnblogs.com/chengjian-physique/p/7906699.html

좋은 웹페이지 즐겨찾기