PowerBuilder Dynamic Execute Script
Source Code
nvo_pbcompiler from nonvisualobject
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
forward global type nvo_pbcompiler from nonvisualobject end type type str_callback from structure within nvo_pbcompiler end type type str_userdata from structure within nvo_pbcompiler end type end forward type str_callback from structure string entryname string libraryname string userid string cmode end type type str_userdata from structure string data ulong datalen end type global type nvo_pbcompiler from nonvisualobject end type global nvo_pbcompiler nvo_pbcompiler type prototypes Function Long GetTempPath(Long nBufferLength, Ref String lpBuffer) Library "kernel32" Alias For "GetTempPathA;Ansi" Function ULong GetModuleFileName(ULong hModule,Ref String lpFileName,ULong nSize) Library "kernel32.dll" Alias For "GetModuleFileNameA;Ansi" Public Function Long sessionopen150 () Library "PBORC150.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose150 (Long horcasession) Library "PBORC150.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist150 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC150.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl150 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC150.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport150 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC150.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete150 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC150.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy150 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC150.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport150 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC150.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen125 () Library "PBORC125.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose125 (Long horcasession) Library "PBORC125.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist125 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC125.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl125 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC125.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport125 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC125.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete125 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC125.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy125 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC125.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport125 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC125.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Integer listcheckoutentries125 (Long horcasession,String lpszlibraryname,Ref str_callback lpcallbackfunction,Ref str_userdata puserdata) Library "PBORC125.DLL" Alias For "PBORCA_ListCheckOutEntries" Public Function Long sessionopen120 () Library "PBORC120.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose120 (Long horcasession) Library "PBORC120.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist120 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC120.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl120 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC120.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport120 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC120.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete120 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC120.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy120 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC120.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport120 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC120.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen115 () Library "PBORC115.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose115 (Long horcasession) Library "PBORC115.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist115 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC115.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl115 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC115.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport115 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC115.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete115 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC115.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy115 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC115.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport115 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC115.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen110 () Library "PBORC110.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose110 (Long horcasession) Library "PBORC110.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist110 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC110.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl110 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC110.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport110 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC110.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete110 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC110.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy110 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC110.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport110 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC110.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen100 () Library "PBORC100.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose100 (Long horcasession) Library "PBORC100.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist100 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC100.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl100 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC100.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport100 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC100.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete100 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC100.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy100 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC100.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport100 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC100.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen105 () Library "PBORC105.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose105 (Long horcasession) Library "PBORC105.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist105 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC105.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl105 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC105.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport105 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC105.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete105 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC105.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy105 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC105.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport105 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC105.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen90 () Library "PBORC90.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose90 (Long horcasession) Library "PBORC90.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist90 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC90.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl90 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC90.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport90 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC90.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete90 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC90.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy90 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC90.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport90 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC90.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen80 () Library "PBORC80.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose80 (Long horcasession) Library "PBORC80.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist80 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC80.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl80 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC80.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport80 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC80.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete80 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC80.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy80 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC80.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport80 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC80.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen70 () Library "PBORC70.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose70 (Long horcasession) Library "PBORC70.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist70 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC70.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl70 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC70.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport70 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC70.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete70 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC70.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy70 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC70.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport70 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC70.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen60 () Library "PBORC60.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose60 (Long horcasession) Library "PBORC60.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist60 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC60.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl60 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC60.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport60 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC60.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete60 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC60.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy60 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC60.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport60 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC60.DLL" Alias For "PBORCA_CompileEntryImport" Public Function Long sessionopen50 () Library "PBORC50.DLL" Alias For "PBORCA_SessionOpen" Public Subroutine sessionclose50 (Long horcasession) Library "PBORC50.DLL" Alias For "PBORCA_SessionClose" Public Function Integer sessionsetlibrarylist50 (Long horcasession,Ref String plibnames[],Integer inumberoflibs) Library "PBORC50.DLL" Alias For "PBORCA_SessionSetLibraryList" Public Function Integer sessionsetcurrentappl50 (Long horcasession,String lpszappllibname,String lpszapplname) Library "PBORC50.DLL" Alias For "PBORCA_SessionSetCurrentAppl" Public Function Integer libraryentryexport50 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,Ref String lpszexportbuffer,Long lexportbuffersize) Library "PBORC50.DLL" Alias For "PBORCA_LibraryEntryExport" Public Function Integer libraryentrydelete50 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype) Library "PBORC50.DLL" Alias For "PBORCA_LibraryEntryDelete" Public Function Integer libraryentrycopy50 (Long horcasession,String lpszsourcelibname,String lpszdestlibname,String lpszentryname,Long otentrytype) Library "PBORC50.DLL" Alias For "PBORCA_LibraryEntryCopy" Public Function Integer compileentryimport50 (Long horcasession,String lpszlibraryname,String lpszentryname,Long otentrytype,String lpszcomments,String lpszentrysyntax,Long lentrysyntaxbuffsize,Long pcomperrorproc,Long puserdata) Library "PBORC50.DLL" Alias For "PBORCA_CompileEntryImport" end prototypes type variables Long pborca_application Long pborca_datawindow = 1 Long pborca_function = 2 Long pborca_menu = 3 Long pborca_query = 4 Long pborca_structure = 5 Long pborca_userobject = 6 Long pborca_window = 7 Long pborca_pipeline = 8 Long pborca_project = 9 Long pborca_proxyobject = 10 Long pborca_binary = 11 Integer pborca_ok Long pborca_invalidparms = -1 Long pborca_dupoperation = -2 Long pborca_objnotfound = -3 Long pborca_badlibrary = -4 Long pborca_liblistnotset = -5 Long pborca_libnotinlist = -6 Long pborca_libioerror = -7 Long pborca_objexists = -8 Long pborca_invalidname = -9 Long pborca_buffertoosmall = -10 Long pborca_comperror = -11 Long pborca_linkerror = -12 Long pborca_currapplnotset = -13 Long pborca_objhasnoancs = -14 Long pborca_objhasnorefs = -15 Long pborca_pbdcounterror = -16 Long pborca_pbdcreaterror = -17 Long pborca_checkouterror = -18 end variables forward prototypes public function string of_gettemppath () public function string of_getapppath () public function integer of_createentry (string as_returntype, string as_pbscript, ref string as_libraryname, ref string as_entryname) public function string of_message (integer ai_code) public function long of_parse (string as_text, string as_sep, ref string as_list[]) end prototypes public function string of_gettemppath ();//==================================================================== // Function: nvo_pbcompiler.of_gettemppath() //-------------------------------------------------------------------- // Description: take temporary path //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: string string temporary path //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/11 //-------------------------------------------------------------------- // Usage: nvo_pbcompiler.of_gettemppath ( ) //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== string ls_path ulong lu_size=256 ls_path=space(256) GetTempPath(lu_size,ls_path) return trim(ls_path) end function public function string of_getapppath ();//==================================================================== // Function: nvo_pbcompiler.of_getapppath() //-------------------------------------------------------------------- // Description: take the application path //-------------------------------------------------------------------- // Arguments: //-------------------------------------------------------------------- // Returns: string string application path //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/11 //-------------------------------------------------------------------- // Usage: nvo_pbcompiler.of_getapppath ( ) //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== String ls_apppath ls_apppath = Space(256) GetModuleFileName(Handle(GetApplication()),ls_apppath,256) ls_apppath = Reverse(ls_apppath) ls_apppath = Reverse(Mid(ls_apppath,Pos(ls_apppath,'\',1))) Return ls_apppath end function public function integer of_createentry (string as_returntype, string as_pbscript, ref string as_libraryname, ref string as_entryname);//==================================================================== // Function: nvo_pbcompiler.of_createentry() //-------------------------------------------------------------------- // Description: Create entity based on dynamic code //-------------------------------------------------------------------- // Arguments: // value string as_returntype return value type // value string as_pbscript dynamic code // reference string as_libraryname the name of the library file created // reference string as_entryname the name of the entity created //-------------------------------------------------------------------- // Returns: integer whether long is successful (1 means success, -1 means failure) //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/11 //-------------------------------------------------------------------- // Usage: nvo_pbcompiler.of_createentry ( string as_returntype, string as_pbscript, ref string as_libraryname, ref string as_entryname ) //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long ll_sid //session number Long ll_index //Object number String ls_librarylist[] //Library file list String ls_librarylist_tmp[] //Library file list (temporary) String ls_temp_libraryname //temporary library file name String ls_temp_path //temporary directory String ls_syntax //Entity syntax String ls_app_libraryname //The name of the library file where the application is located Integer li_result //result String ls_entryname //Object name ClassDefinition lcd_app //Application class definition object String ls_librarylist_files //Library files Integer i,j //temporary variable //Exit directly under the development environment If Handle(GetApplication()) <= 0 Then Return -1 //Get the list of library files ls_librarylist_files = getlibrarylist () //Take the pbl where the application object is located lcd_app = GetApplication().ClassDefinition ls_app_libraryname = lcd_app.LibraryName ls_temp_path = This.of_gettemppath() //Take the temporary directory //ls_temp_path = "D:\BAOGADATA\GASOURCE\MYCODE\POWERBUILDER\PMIT\PBDynamicExecuteScript\" //Get the name of the temporary library file to be created ll_index = 1 ls_temp_libraryname = ls_temp_path + "temp"+String(ll_index) + ".pbl" Do While FileExists(ls_temp_libraryname) Or Pos(","+ls_librarylist_files+",",","+ls_temp_libraryname+",") > 0 ll_index ++ ls_temp_libraryname = ls_temp_path + "temp"+String(ll_index) + ".pbl" Loop //Create a temporary library file LibraryCreate(ls_temp_libraryname,"baoga") of_parse(ls_librarylist_files,',',ls_librarylist) //decompose the string into an array //Determine whether the library file exists and form a new list j = 0 For i = 1 To UpperBound(ls_librarylist) If FileExists(ls_librarylist[i]) Then j ++ ls_librarylist_tmp[j] = ls_librarylist[i] End If Next ls_librarylist = ls_librarylist_tmp ls_librarylist[UpperBound(ls_librarylist)+1] = ls_temp_libraryname ll_sid = SessionOpen105() //Open a session //Set the library list of the current session li_result = SessionSetLibraryList105 (ll_sid, ls_librarylist, UpperBound(ls_librarylist)) If li_result = 0 Then //Set the application corresponding to the current session li_result = SessionSetCurrentAppl105 (ll_sid, ls_app_libraryname, GetApplication().AppName) If li_result = 0 Then //Take the entity name (guaranteed not to be repeated) ll_index = 1 Do While Not IsNull(FindClassDefinition("nvo_"+String(ll_index))) ll_index ++ Loop ls_entryname = "nvo_"+String(ll_index) //Entity declaration ls_syntax = "$PBExportHeader$"+ls_entryname+".sru"+"~r~n"& + "forward"+"~r~n"& + "global type "+ls_entryname+" from nonvisualobject"+"~r~n"& + "end type"+"~r~n"& + "end forward"+"~r~n"& + "~r~n"& + "global type "+ls_entryname+" from nonvisualobject"+"~r~n"& + "end type"+"~r~n"& + "global "+ls_entryname+" "+ls_entryname+""+"~r~n"& + "~r~n"& + "forward prototypes"+"~r~n" //Distinguish between function and process If Trim(Lower(as_returntype)) = 'none' Or Trim(Lower(as_returntype)) = '' Then ls_syntax = ls_syntax + "public subroutine of_exec ()"+"~r~n"& + "end prototypes"+"~r~n"& + "~r~n"& + "public subroutine of_exec ();"+as_pbscript+"~r~n"& + "end subroutine" Else ls_syntax = ls_syntax + "public function "+ as_returntype +" of_exec ()"+"~r~n"& + "end prototypes"+"~r~n"& + "~r~n"& + "public function "+ as_returntype +" of_exec ();"+as_pbscript+"~r~n"& + "end function" End If //End of entity syntax ls_syntax = ls_syntax + "~r~n" + "on "+ ls_entryname + ".create"+"~r~n"& + "call super::create"+"~r~n"& + "TriggerEvent( this, ~"constructor~" )"+"~r~n"& + "end on"+"~r~n"& + "~r~n"& + "on "+ ls_entryname + ".destroy"+"~r~n"& + "TriggerEvent( this, ~"destructor~" )"+"~r~n"& + "call super::destroy"+"~r~n"& + "end on" //Import and compile entities li_result = CompileEntryImport105 (ll_sid, ls_temp_libraryname, ls_entryname, 6, "comment-new object", ls_syntax, Len(ls_syntax) *2, 0, 0) End If End If SessionClose105(ll_sid) //Close a session as_libraryname = ls_temp_libraryname as_entryname = ls_entryname //Add new files to the library file search list AddToLibraryList(ls_temp_libraryname) If li_result = 0 Then Return 1 Else MessageBox("Warning",of_message(li_result)) Return -1 End If end function public function string of_message (integer ai_code); /* Code Description ---- ----------------------------------- 0 Operation successful -1 Invalid parameter list -2 Duplicate operation -3 Object not found -4 Bad library name -5 Library list not set -6 Library not in library list -7 Library I/O error -8 Object exists -9 Invalid name -10 Buffer size is too small -11 Compile error -12 Link error -13 Current application not set -14 Object has no ancestors -15 Object has no references -16 Invalid # of PBDs -17 PBD create error -18 Source Management error */ String ls_message Choose Case ai_code Case 0 ls_message = 'Operation successful' Case -1 ls_message = 'Invalid parameter list' Case -2 ls_message = 'Duplicate operation' Case -3 ls_message = 'Object not found' Case -4 ls_message = 'Bad library name' Case -5 ls_message = 'Library list not set' Case -6 ls_message = 'Library not in library list' Case -7 ls_message = 'Library I/O error' Case -8 ls_message = 'Object exists' Case -9 ls_message = 'Invalid name' Case -10 ls_message = 'Buffer size is too small' Case -11 ls_message = 'Compile error' Case -12 ls_message = 'Link error' Case -13 ls_message = 'Current application not set' Case -14 ls_message = 'Object has no ancestors' Case -15 ls_message = 'Object has no references' Case -16 ls_message = 'Invalid # of PBDs' Case -17 ls_message = 'PBD create error' Case -18 ls_message = 'Source Management error' Case Else ls_message = '' End Choose Return ls_message end function public function long of_parse (string as_text, string as_sep, ref string as_list[]);//==================================================================== // Function: nvo_pbcompiler.of_parse() //-------------------------------------------------------------------- // Description: Analyze the string into an array //-------------------------------------------------------------------- // Arguments: // value string as_text source string // value string as_sep separator character // value string as_list[] String array formed after analysis //-------------------------------------------------------------------- // Returns: long the number of array elements formed after long analysis //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/11 //-------------------------------------------------------------------- // Usage: nvo_pbcompiler.of_parse ( string as_text, string as_sep, string as_list[] ) //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== Long i,ll_pos String ls_null[],ls_text ls_text = as_text as_list = ls_null i = 0 ll_pos = Pos(Lower(ls_text),Lower(as_sep)) Do While ll_pos > 0 i ++ as_list[i] = Left(ls_text,ll_pos - 1) ls_text = Mid(ls_text,ll_pos + Len(as_sep),Len(ls_text)) ll_pos = Pos(Lower(ls_text),Lower(as_sep)) Loop as_list[i + 1] = ls_text Return UpperBound(as_list[]) end function on nvo_pbcompiler.create call super::create TriggerEvent( this, "constructor" ) end on on nvo_pbcompiler.destroy TriggerEvent( this, "destructor" ) call super::destroy end on |
f_execpbscript from function_object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
global type f_execpbscript from function_object end type forward prototypes global function string f_execpbscript (string as_returntype, string as_pbscript) end prototypes global function string f_execpbscript (string as_returntype, string as_pbscript);//==================================================================== // Function: f_execpbscript() //-------------------------------------------------------------------- // Description: execute dynamic code (only return string) //-------------------------------------------------------------------- // Arguments: // value string as_returntype string return value type // value string as_pbscript dynamic code //-------------------------------------------------------------------- // Returns: string string user-defined or error message //-------------------------------------------------------------------- // Author: PB.BaoGa Date: 2021/06/11 //-------------------------------------------------------------------- // Usage: f_execpbscript ( string as_returntype, string as_pbscript ) //-------------------------------------------------------------------- // Copyright (c) PB.BaoGa(TM), All rights reserved. //-------------------------------------------------------------------- // Modify History: // //==================================================================== nvo_pbcompiler lnv_pbcompiler nonvisualobject luo_pbcompiler String ls_entryname,ls_libraryname String ls_return Any la_return lnv_pbcompiler = Create nvo_pbcompiler //Create entity object If lnv_pbcompiler.of_createentry(as_returntype,as_pbscript,ls_libraryname,ls_entryname) = 1 Then If Not IsNull(FindClassDefinition(ls_entryname)) Then luo_pbcompiler = Create Using ls_entryname Choose Case Lower(as_returntype) Case'any','blob','boolean','char','character','date','datetime','dec','decimal','double','int','integer',' long','real','string','time','uint','ulong','unsignedint','unsignedinteger','unsignedlong' la_return = luo_pbcompiler.Dynamic of_exec() //Execute dynamic code ls_return = String(la_return) Case'','none' luo_pbcompiler.Dynamic of_exec() //Execute dynamic code ls_return = "none" Case Else luo_pbcompiler.Dynamic of_exec() //Execute dynamic code ls_return = "result is disabled" End Choose If IsValid(luo_pbcompiler) Then Destroy luo_pbcompiler Else ls_return = "FindClassDefinition error" End If Else ls_return = "of_createentry error" End If If IsValid(lnv_pbcompiler) Then Destroy lnv_pbcompiler LibraryDelete(ls_libraryname) Return ls_return end function |
w_main from window
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
forward global type w_main from window end type type st_returnvalue from statictext within w_main end type type st_returntype from statictext within w_main end type type st_script from statictext within w_main end type type sle_returnvalue from singlelineedit within w_main end type type cb_exit from commandbutton within w_main end type type sle_returntype from singlelineedit within w_main end type type mle_script from multilineedit within w_main end type type cb_ok from commandbutton within w_main end type end forward global type w_main from window integer width = 2030 integer height = 1040 boolean titlebar = true string title = "PB Dynamic Script" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean resizable = true long backcolor = 67108864 string icon = "AppIcon!" boolean center = true st_returnvalue st_returnvalue st_returntype st_returntype st_script st_script sle_returnvalue sle_returnvalue cb_exit cb_exit sle_returntype sle_returntype mle_script mle_script cb_ok cb_ok end type global w_main w_main type prototypes end prototypes type variables end variables on w_main.create this.st_returnvalue=create st_returnvalue this.st_returntype=create st_returntype this.st_script=create st_script this.sle_returnvalue=create sle_returnvalue this.cb_exit=create cb_exit this.sle_returntype=create sle_returntype this.mle_script=create mle_script this.cb_ok=create cb_ok this.Control[]={this.st_returnvalue,& this.st_returntype,& this.st_script,& this.sle_returnvalue,& this.cb_exit,& this.sle_returntype,& this.mle_script,& this.cb_ok} end on on w_main.destroy destroy(this.st_returnvalue) destroy(this.st_returntype) destroy(this.st_script) destroy(this.sle_returnvalue) destroy(this.cb_exit) destroy(this.sle_returntype) destroy(this.mle_script) destroy(this.cb_ok) end on type st_returnvalue from statictext within w_main integer x = 9 integer y = 608 integer width = 347 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 long backcolor = 67108864 string text = "Return Value:" alignment alignment = right! boolean focusrectangle = false end type type st_returntype from statictext within w_main integer x = 9 integer y = 476 integer width = 347 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 long backcolor = 67108864 string text = "Return Type:" alignment alignment = right! boolean focusrectangle = false end type type st_script from statictext within w_main integer x = 9 integer y = 12 integer width = 347 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 long backcolor = 67108864 string text = "PB Script:" alignment alignment = right! boolean focusrectangle = false end type type sle_returnvalue from singlelineedit within w_main integer x = 370 integer y = 608 integer width = 1582 integer height = 104 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type type cb_exit from commandbutton within w_main integer x = 1701 integer y = 792 integer width = 242 integer height = 104 integer taborder = 50 integer textsize = -9 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "Exit" end type event clicked;close(parent) end event type sle_returntype from singlelineedit within w_main integer x = 370 integer y = 476 integer width = 1582 integer height = 104 integer taborder = 20 integer textsize = -9 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 borderstyle borderstyle = stylelowered! end type type mle_script from multilineedit within w_main integer x = 370 integer y = 12 integer width = 1582 integer height = 432 integer taborder = 10 integer textsize = -9 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 boolean vscrollbar = true boolean autovscroll = true borderstyle borderstyle = stylelowered! end type type cb_ok from commandbutton within w_main integer x = 1454 integer y = 792 integer width = 242 integer height = 104 integer taborder = 40 integer textsize = -9 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "Run" end type event clicked;sle_returnvalue.text = f_execpbscript(sle_returntype.text,mle_script.text) end event |
Find Projects On Github click here
Good Luck!
Subscribe
Login
0 Comments
Oldest