我是新手小白,由于刚接手上一任同事的工作,不太明白人家写的代码的含义,想麻烦您给我解释一下每一句命令的含义,谢谢谢谢

2501_92615255 2025-12-05 11:09:57

close all
set talk off
set safe off
set sysmenu off
set century on
set date to YMD
set status bar off
set deleted on
SET RESOURCE OFF
on shutdown quit
modify window screen title "工作证打印程序2025"
modify window screen fill file "beijing.jpg"
zoom window screen max
*_screen.controlbox=.f.      &&最大化、最小化、关闭按钮

Pm_k=wcols()
Pm_g=wrows()

@(Pm_g-9),(Pm_k-36) say "  程序:工作证打印系统   " color 5/3
@(Pm_g-8),(Pm_k-36) say "  编程:xxxxx " color 1/6
@(Pm_g-7),(Pm_k-36) say "  时间:  2021.5.27        -0822   " color 5/3
@(Pm_g-6),(Pm_k-36) say "  地点:xx地方 " color 5/3

set defa to left(sys(16),rat("\",sys(16)))
set path to date;img;system32
if allt(dtos(date()))>'20301025'
  messagebox("你需要更新你的软件了!",0+16+0,"提示窗口")
endif
if allt(dtos(date()))>'20301025'
  messagebox("对不起,你已超过规定的使用期限,再见!",0+16+0,"提示窗口")
  quit
endif


do 菜单.mpr
read events 

...全文
62 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
cf_nxcxy 2025-12-09
  • 打赏
  • 举报
回复
  • 关闭所有工作区和数据表
    close all

  • 关闭命令执行结果显示
    set talk off

  • 关闭安全警告提示
    set safe off

  • 关闭系统菜单
    set sysmenu off

  • 设置年份显示为4位数(世纪格式)
    set century on

  • 设置日期格式为年月日
    set date to YMD

  • 关闭状态栏显示
    set status bar off

  • 忽略已标记删除的记录(不显示已删除记录)
    set deleted on

  • 关闭资源文件
    SET RESOURCE OFF

  • 定义程序关闭时的退出行为
    on shutdown quit

  • 修改主窗口标题
    modify window screen title "工作证打印程序2025"

  • 设置主窗口背景图片
    modify window screen fill file "beijing.jpg"

  • 最大化主窗口
    zoom window screen max

  • 注释掉的代码:隐藏窗口控制按钮(最大化、最小化、关闭按钮)

  • _screen.controlbox=.f.

  • 获取当前窗口的列数(宽度)
    Pm_k=wcols()

  • 获取当前窗口的行数(高度)
    Pm_g=wrows()

  • 在窗口右下角显示程序信息(行、列坐标定位)
    @(Pm_g-9),(Pm_k-36) say " 程序:工作证打印系统 " color 5/3 && 紫色文字/青色背景
    @(Pm_g-8),(Pm_k-36) say " 编程:xxxxx " color 1/6 && 蓝色文字/黄色背景
    @(Pm_g-7),(Pm_k-36) say " 时间: 2021.5.27 -0822 " color 5/3
    @(Pm_g-6),(Pm_k-36) say " 地点:xx地方 " color 5/3

  • 设置默认工作目录为程序所在目录
    set defa to left(sys(16),rat("",sys(16)))

  • 设置搜索路径:date、img、system32文件夹
    set path to date;img;system32

  • 软件使用期限检查(第一个检查点)
    if allt(dtos(date()))>'20301025' && 如果当前日期大于2030年10月25日
    messagebox("你需要更新你的软件了!",0+16+0,"提示窗口") && 显示警告对话框
    endif

  • 软件使用期限检查(第二个检查点)
    if allt(dtos(date()))>'20301025' && 如果当前日期大于2030年10月25日
    messagebox("对不起,你已超过规定的使用期限,再见!",0+16+0,"提示窗口")
    quit && 退出程序
    endif

  • 加载并运行菜单程序
    do 菜单.mpr

  • 进入事件循环,等待用户交互
    read events

2,749

社区成员

发帖
与我相关
我的任务
社区描述
VFP,是Microsoft公司推出的数据库开发软件,用它来开发数据库,既简单又方便。
社区管理员
  • VFP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧