|
ARY "FUNCky32.DLL"SCRIPT:... //从数据库中将数据取出保存在文件$fgd.bmp中status = fdcompress("$fgd.bmp","_fgd.bmp")//解压缩choose case status...//检查返回值End choose...//将_fgd.bmp读入blob变量picll_width = _blob2long(pic,18) //读图象宽度ll_height = _blob2long(pic,22) //读图象高度//根据指定的宽和高计算缩放比例bili_width = integer(sle_width.text) / ll_widthbili_height = integer(sle_height.text) / ll_height//得到显示宽度和高度p_width = ll_width * min(bili_width, bili_height)p_height = ll_height * min(bili_width, bili_height)我 们可 以 看 到Funcky 函 数 的 使 用 非 常 简 单, 能 够 轻 松 做 到 在PowerBuilder 中 很 难 实 现 的 操 作。 2. 在 应 用 中 您 可 能 会 遇 到 直 接 读 取DBF 文 件 的 情 况, 处 理 这 类 问 题 的 方 法 一 般 有 两 种 经 典 的方 法: 一 是 使 用 数 据 窗 口 读DBF 文 件, 二 是 指 定 一 个 磁盘 目 录 作 为 数 据 区, 用ODBC 连 接 这 个 目 录, 使 用 时 规 定用 户 必 须 将DBF 文 件 拷 贝 到 这 个 目 录 下。 但 是 这 两 种 方法 都 缺 乏 灵 活 性, 而 在Funcky 中 却 提 供 了 直 接 读DBF 文 件的 函 数。 在Funcky32.pbl 中 有 一 个dbffieldget() 函 数 可 以 获 取 该DBF 文 件 的 字 段 名 称。 不 过 根 据 我 们“ 尽 量 不 使 用Funcky32.pbl” 的 原 则, 自 己 手 工 编 写 一 个 实 现 该 功 能 的 代 码。 定 义 外 部函 数: FUNCTION long dbfOpen(string f, int o)LIBRARY "FUNCky32.DLL"FUNCTION boolean dbfEof(long d)LIBRARY "FUNCky32.DLL"FUNCTION int dbfClose(long d)LIBRARY "FUNCky32.DLL"FUNCTION long dbfSkip(long d, long c)LIBRARY "FUNCky32.DLL"FUNCTION uint dbfFieldSize(long d, int p)LIBRARY "FUNCky32.DLL"SUBROUTINE _dbfFieldGet(long d,int p,ref string b)LIBRARY "FUNCky32.DLL"FUNCTION int dbfFieldPos(long d,string n)LIBRARY "FUNCky32.DLL"SCRIPT://以读写和拒绝其他用户写的方式打开dbf数据库do while 1 = 1dbf = dbfopen(ls_file, 2 + 32)if dbf <> 0 thenexitend ifloop//读d 上一页 [1] [2] [3] [4] 下一页
|