Local gnFileHandle,nSize,cString
gnFileHandle = FOPEN("test.txt")
* Seek to end of file to determine number of bytes in the file.
nSize = FSEEK(gnFileHandle, 0, 2) &&移动指针到末尾
IF nSize <= 0
* If file is empty, display an error message.
WAIT WINDOW "亏圆This file is empty!" NOWAIT
ELSE
* If file is not empty, store the file's contents in memory
* and display the text in the main Visual FoxPro window.
= FSEEK(gnFileHandle, 0, 0) &&移动指针到开始
cString = FREAD(gnFileHandle, nSize)
? cString
&&这个变量赋值给textbox。value
ENDIF
= FCLOSE(gnFileHandle) &&关闭文桥逗件
给你个例子:MESSAGEBOX("这填写你需要的信息")使用方法:
显示一个用户自定义对话框。
MESSAGEBOX(eMessageText [, nDialogBoxType ][, cTitleBarText][, nTimeout])参数eMessageText指定在对话框中显示的文本。还可以指定任何有效的 Visual FoxPro 函数、对象或数据类型来取代
eMessageText。指定的明伏文本最多可以有 1024 个字符。
nDialogBoxType指定对话框中的按钮和图标、显示对话框时的默认按钮以及对话框的行为。在下面的表中,对激者携话框按钮值从 0 到 5 指定了对话框中显示的按钮。图标值
16、32、48 和 64 指定了对话框中的图标。默认值 0、256 和 512 指定对话框中哪个按钮为默认按钮。当显示对话框时选中此默认按钮。当省略
nDialogBoxType 时,等同于指定 nDialogBoxType 值为 0。
cTitleBarText指定对话框标题栏中的文本。若省略 cTitleBarText,标题栏嫌粗中将显示 "Microsoft Visual FoxPro" 。
nTimeout指定在清除 eMessageText 前, 没有键盘或鼠标输入时的 Visual FoxPro 显示
eMessageText 的毫秒数。可以指定任何可用的超时。小于 1 的值在用户输入前不会产生超时 (与没有指定 nTimeout
参数相同)。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)