网站导航网学 原创论文 原创专题 网站设计 最新系统 原创论文 论文降重 发表论文 论文发表 UI设计定制 论文答辩PPT格式排版 期刊发表 论文专题
返回网学首页
网学原创论文
最新论文 推荐专题 热门论文 论文专题
当前位置: 网学 > 设计资源 > 实用代码片段 > 正文

收藏的一些实用代码

论文降重修改服务、格式排版等 获取论文 论文降重及排版 论文发表 相关服务
(li_Blocks - 1)*BlockSize]

  // in increments of BlockSize

  ll_Offset = (Rand(li_Blocks) - 1) * li_BlockSize

  //Main Calculation

  ll_Return = ll_Offset + Rand(li_Range)

  LOOP

  Return ll_Return

  字符串转为数组

  /**************************************************************

  Powerbuilder 6.5 / 7.0

  long StringToArray( readonly string sString,

  readonly string sSeparator,

  reference string sOutputArray[] )

  This function parses string to array depending on the

  string separator. The count of items parsed is returned.

  by Mike Bartos (yawor@yawor.com)

  ****************************************************************/

  LONG lPosEnd, lPosStart = 1, lSeparatorLen, lCounter = 1

  IF UpperBound(sOutputArray) > 0 THEN sOutputArray = {""}

  lSeparatorLen = len(sSeparator)

  lPosEnd = Pos (sString, sSeparator, 1)

  DO WHILE lPosEnd > 0

  sOutputArray[lCounter] = Mid (sString, lPosStart, lPosEnd - lPosStart)

  lPosStart = lPosEnd + lSeparatorLen

  lPosEnd = Pos (sString, sSeparator, lPosStart)

  lCounter++

  LOOP

  sOutputArray[lCounter] = Right (sString, Len(sString) - lPosStart + 1)

  RETURN lCounter

  动态创建数据仓库来对数组排序

  datastore lds_temp

  string ls_err

  integer i

  // change the datastore definition according to the array data type

  long ll_array[] = { 2 , 3, 6, 5 }

  string ls_dsdef = &

  'release 6; datawindow() table(column=(type=long name=a dbname="a") )'

  lds_temp = CREATE datastore

  lds_temp.Create(ls_dsdef, ls_err)

  // put the array in the datastore

  lds_temp.o b j e c t.a.current = ll_array

  lds_temp.SetSort("a ASC")

  lds_temp.Sort()

  // get back the array

  ll_array = lds_temp.o b j e c t.a.current

  FOR i = 1 to Upperbound(ll_array)

  MessageBox("", string(ll_array[i]))

  NEXT

  DESTROY lds_temp

  执行外部程序并等待

  OleObject wsh

  integer li_rc

  CONSTANT integer MAXIMIZED = 3

  CONSTANT integer MINIMIZED = 2

  CONSTANT integer NORMAL = 1

  CONSTANT boolean WAIT = TRUE

  CONSTANT boolean NOWAIT = FALSE

  wsh = CREATE OleObject

  li_rc = wsh.ConnectToNewObject( "WScript.Shell" )

  li_rc = wsh.Run("Notepad" , NORMAL, WAIT)

  messagebox("hello", "world")

  If WAITING, then Run returns any error code returned by the application.

  In the example only three CONSTANTs are defined. But more options are available : 0 Hides the window and activates another window.

  1 Activates and displays a window. If the window is minimized or

  maximized, the system restores it to its original size and position. An

  application should specify this flag when displaying the window for the

  first time.

  2 Activates the window and displays it as a minimized window.

  3 Activates the window and displays it as a maximized window.

  4 Di

设为首页 | 加入收藏 | 网学首页 | 原创论文 | 计算机原创
版权所有 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2020 myeducs.Cn www.myeducs.Cn All Rights Reserved 湘ICP备09003080号 常年法律顾问:王律师