Power Script References Unidad 3

1236
PowerScript ® Reference PowerBuilder ® 11.5

description

Power Builder

Transcript of Power Script References Unidad 3

PowerScript Reference

PowerBuilder11.5

DOCUMENT ID: DC37781-01-1150-01 LAST REVISED: September 2008 Copyright 2008 by Sybase, Inc. All rights reserved. This publication pertains to Sybase software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement. To order additional documents, U.S. and Canadian customers should call Customer Fulfillment at (800) 685-8225, fax (617) 229-9845. Customers in other countries with a U.S. license agreement may contact Customer Fulfillment via the above fax number. All other international customers should contact their Sybase subsidiary or local distributor. Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc. Sybase trademarks can be viewed at the Sybase trademarks page at http://www.sybase.com/detail?id=1011207. Sybase and the marks listed are trademarks of Sybase, Inc. indicates registration in the United States of America. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. All other company and product names mentioned may be trademarks of the respective companies with which they are associated. Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies. Sybase, Inc., One Sybase Drive, Dublin, CA 94568.

Contents

About This Book ........................................................................................................................ xxv

PART 1 CHAPTER 1

POWERSCRIPT TOPICS Language Basics............................................................................. 3 Comments ........................................................................................ 3 Identifier names................................................................................ 5 Labels............................................................................................... 6 Special ASCII characters ................................................................. 6 NULL values..................................................................................... 8 Reserved words ............................................................................. 10 Pronouns ........................................................................................ 11 Parent pronoun........................................................................ 12 This pronoun ........................................................................... 13 Super pronoun......................................................................... 14 Statement continuation .................................................................. 15 Statement separation ..................................................................... 16 White space ................................................................................... 16 Conditional compilation .................................................................. 17 Datatypes ....................................................................................... Standard datatypes ........................................................................ The Any datatype ........................................................................... System object datatypes ................................................................ Enumerated datatypes ................................................................... PowerBuilder datatypes in EAServer ............................................. Declarations................................................................................... Declaring variables......................................................................... Where to declare variables...................................................... About using variables .............................................................. Syntax of a variable declaration .............................................. 2121 26 29 30 31

CHAPTER 2

CHAPTER 3

3333 34 35 37

PowerScript Reference

iii

Contents

Declaring constants........................................................................ Declaring arrays ............................................................................. Values for array elements ....................................................... Size of variable-size arrays ..................................................... More about arrays ................................................................... Declaring external functions ........................................................... Datatypes for external function arguments.............................. Calling external functions ........................................................ Defining source for external functions ..................................... Declaring DBMS stored procedures as remote procedure calls ....

47 48 51 52 54 57 62 64 64 65

CHAPTER 4

Operators and Expressions.......................................................... 69 Operators in PowerBuilder ............................................................. 69 Arithmetic operators in PowerBuilder ...................................... 70 Relational operators in PowerBuilder ...................................... 72 Concatenation operator in PowerBuilder................................. 73 Operator precedence in PowerBuilder expressions....................... 74 Datatype of PowerBuilder expressions .......................................... 75 Numeric datatypes in PowerBuilder ........................................ 75 String and char datatypes in PowerBuilder ............................. 78 Structures and Objects ................................................................. 79 About structures ............................................................................. 79 About objects ................................................................................. 80 About user objects................................................................... 81 Instantiating objects................................................................. 83 Using ancestors and descendants .......................................... 84 Garbage collection .................................................................. 84 User objects that behave like structures ................................. 85 Assignment for objects and structures ........................................... 86 Assignment for structures........................................................ 86 Assignment for objects ............................................................ 87 Assignment for autoinstantiated user objects.......................... 88 Calling Functions and Events ...................................................... 91 About functions and events............................................................ 91 Finding and executing functions and events .................................. 94 Finding functions ..................................................................... 94 Finding events ......................................................................... 95 Triggering versus posting functions and events............................. 96

CHAPTER 5

CHAPTER 6

iv

PowerBuilder

Contents

Static versus dynamic calls ............................................................ 98 Static calls ............................................................................... 98 Dynamic calls .......................................................................... 99 Overloading, overriding, and extending functions and events ..... 104 Overloading and overriding functions.................................... 104 Extending and overriding events ........................................... 105 Passing arguments to functions and events ................................ 106 Passing objects ..................................................................... 106 Passing structures................................................................. 107 Passing arrays....................................................................... 108 Using return values ...................................................................... 109 Functions............................................................................... 109 Events ................................................................................... 109 Using cascaded calling and return values............................. 110 Syntax for calling PowerBuilder functions and events ................. 111 Calling functions and events in an objects ancestor ................... 114

PART 2 CHAPTER 7

STATEMENTS, EVENTS, AND FUNCTIONS PowerScript Statements............................................................. Assignment .................................................................................. CALL ............................................................................................ CHOOSE CASE........................................................................... CONTINUE .................................................................................. CREATE....................................................................................... DESTROY.................................................................................... DO...LOOP................................................................................... EXIT ............................................................................................. FOR...NEXT ................................................................................. GOTO........................................................................................... HALT ............................................................................................ IF...THEN ..................................................................................... RETURN ...................................................................................... THROW........................................................................................ THROWS ..................................................................................... TRY...CATCH...FINALLY...END TRY .......................................... SQL Statements .......................................................................... Using SQL in scripts..................................................................... CLOSE Cursor ...................................................................... CLOSE Procedure................................................................. COMMIT................................................................................ 119 120 123 124 126 127 130 131 133 134 136 137 138 140 141 142 143 145 146 149 150 151

CHAPTER 8

PowerScript Reference

v

Contents

CONNECT............................................................................. DECLARE Cursor.................................................................. DECLARE Procedure............................................................ DELETE ................................................................................ DELETE Where Current of Cursor ........................................ DISCONNECT....................................................................... EXECUTE ............................................................................. FETCH .................................................................................. INSERT ................................................................................. OPEN Cursor ........................................................................ ROLLBACK ........................................................................... SELECT ................................................................................ SELECTBLOB....................................................................... UPDATE................................................................................ UPDATEBLOB ...................................................................... UPDATE Where Current of Cursor ....................................... Using dynamic SQL ..................................................................... Dynamic SQL Format 1......................................................... Dynamic SQL Format 2......................................................... Dynamic SQL Format 3......................................................... Dynamic SQL Format 4.........................................................

152 153 153 155 156 156 157 158 159 160 160 161 162 164 165 166 167 171 172 173 176

CHAPTER 9

PowerScript Events ..................................................................... About events ................................................................................ Activate ........................................................................................ BeginDownload ............................................................................ BeginDrag .................................................................................... BeginLabelEdit ............................................................................. BeginLogScan.............................................................................. BeginRightDrag ............................................................................ BeginSync .................................................................................... BeginUpload................................................................................. Clicked ......................................................................................... Close ............................................................................................ CloseQuery .................................................................................. CloseUp ....................................................................................... ColumnClick ................................................................................. ConnectMobiLink ......................................................................... Constructor................................................................................... DataChange ................................................................................. DateChanged ............................................................................... DateSelected................................................................................ DBError ........................................................................................ DBNotification ..............................................................................

183183 186 186 187 190 192 192 195 195 196 202 204 205 206 207 208 209 209 210 210 212

vi

PowerBuilder

Contents

Deactivate .................................................................................... DeleteAllItems .............................................................................. DeleteItem.................................................................................... Destructor..................................................................................... DisconnectMobiLink ..................................................................... DisplayMessage........................................................................... DoubleClicked .............................................................................. DragDrop...................................................................................... DragEnter..................................................................................... DragLeave.................................................................................... DragWithin ................................................................................... DropDown .................................................................................... EndDownload............................................................................... EndLabelEdit................................................................................ EndLogScan................................................................................. EndSync....................................................................................... EndUpload ................................................................................... Error ............................................................................................. ErrorMessage............................................................................... ExternalException ........................................................................ FileExists...................................................................................... FileMessage................................................................................. Gesture ........................................................................................ GetFocus...................................................................................... Help.............................................................................................. Hide.............................................................................................. HotLinkAlarm................................................................................ Idle ............................................................................................... InputFieldSelected ....................................................................... InsertItem ..................................................................................... ItemActivate ................................................................................. ItemChanged................................................................................ ItemChanging............................................................................... ItemCollapsed .............................................................................. ItemCollapsing ............................................................................. ItemExpanded .............................................................................. ItemExpanding ............................................................................. ItemPopulate ................................................................................ Key ............................................................................................... LineDown ..................................................................................... LineLeft ........................................................................................ LineRight ...................................................................................... LineUp.......................................................................................... LoseFocus....................................................................................

215 215 216 217 217 218 219 222 227 228 229 232 232 233 234 235 236 236 239 240 243 244 244 246 247 248 249 249 250 250 251 252 253 254 255 256 257 258 258 260 261 262 263 264

PowerScript Reference

vii

Contents

Modified........................................................................................ MouseDown ................................................................................. MouseMove.................................................................................. MouseUp...................................................................................... Moved .......................................................................................... Notify ............................................................................................ Open ............................................................................................ Other ............................................................................................ PageDown.................................................................................... PageLeft....................................................................................... PageRight .................................................................................... PageUp ........................................................................................ PictureSelected ............................................................................ PipeEnd........................................................................................ PipeMeter..................................................................................... PipeStart ...................................................................................... PrintFooter ................................................................................... PrintHeader .................................................................................. ProgressIndex .............................................................................. PropertyChanged ......................................................................... PropertyRequestEdit .................................................................... RButtonDown ............................................................................... RButtonUp.................................................................................... RecognitionResult ........................................................................ RemoteExec................................................................................. RemoteHotLinkStart ..................................................................... RemoteHotLinkStop ..................................................................... RemoteRequest ........................................................................... RemoteSend ................................................................................ Rename........................................................................................ Resize .......................................................................................... RightClicked ................................................................................. RightDoubleClicked...................................................................... Save ............................................................................................. SaveObject................................................................................... Selected ....................................................................................... SelectionChanged ........................................................................ SelectionChanging ....................................................................... Show ............................................................................................ Sort............................................................................................... SQLPreview ................................................................................. Start.............................................................................................. Stop.............................................................................................. Stroke...........................................................................................

265 267 269 272 275 276 276 280 280 281 283 284 285 285 286 287 287 288 288 289 290 291 293 293 294 294 295 295 296 296 297 298 299 301 302 303 304 307 309 310 312 313 314 314

viii

PowerBuilder

Contents

SyncPreview ................................................................................ SystemError ................................................................................. SystemKey ................................................................................... Timer ............................................................................................ ToolbarMoved .............................................................................. UploadAck.................................................................................... UserString .................................................................................... ValueChanged ............................................................................. ViewChange................................................................................. WaitForUploadAck ....................................................................... WarningMessage .........................................................................

315 315 316 317 319 320 321 322 322 323 323

CHAPTER 10

PowerScript Functions ............................................................... Abs ............................................................................................... ACos ............................................................................................ Activate ........................................................................................ AddCategory ................................................................................ AddColumn .................................................................................. AddData ....................................................................................... AddItem........................................................................................ AddLargePicture .......................................................................... AddPicture.................................................................................... AddSeries..................................................................................... AddSmallPicture........................................................................... AddStatePicture ........................................................................... AddToLibraryList .......................................................................... Arrange ........................................................................................ ArrangeSheets ............................................................................. Asc ............................................................................................... AscA............................................................................................. ASin.............................................................................................. ATan............................................................................................. Beep............................................................................................. BeginTransaction ......................................................................... Blob .............................................................................................. BlobEdit........................................................................................ BlobMid ........................................................................................ BuildModel ................................................................................... Byte .............................................................................................. Cancel .......................................................................................... CancelSync .................................................................................. CanUndo ...................................................................................... CategoryCount ............................................................................. CategoryName .............................................................................

325 326 326 327 329 330 331 333 338 339 340 341 342 343 344 345 346 346 348 349 349 350 351 353 354 355 358 359 360 360 361 362 ix

PowerScript Reference

Contents

Ceiling .......................................................................................... ChangeDirectory .......................................................................... ChangeMenu................................................................................ Char ............................................................................................. CharA ........................................................................................... Check ........................................................................................... ChooseColor ................................................................................ ClassList....................................................................................... ClassName................................................................................... Clear............................................................................................. ClearBoldDates ............................................................................ Clipboard...................................................................................... Close ............................................................................................ CloseChannel............................................................................... CloseTab...................................................................................... CloseUserObject .......................................................................... CloseWithReturn .......................................................................... CollapseItem ................................................................................ CommandParm ............................................................................ CommitTransaction ...................................................................... ConnectToNewObject .................................................................. ConnectToNewRemoteObject ..................................................... ConnectToObject ......................................................................... ConnectToRemoteObject............................................................. ConnectToServer ......................................................................... Copy............................................................................................. CopyRTF...................................................................................... Cos............................................................................................... Cpu............................................................................................... CreateDirectory ............................................................................ CreateInstance............................................................................. CreatePage .................................................................................. Cut................................................................................................ DataCount .................................................................................... DataSource .................................................................................. Date.............................................................................................. DateTime...................................................................................... Day............................................................................................... DayName ..................................................................................... DayNumber .................................................................................. DaysAfter ..................................................................................... DBHandle..................................................................................... DebugBreak ................................................................................. Dec...............................................................................................

363 363 364 365 366 367 368 368 369 372 373 374 376 380 381 382 383 386 387 388 390 392 393 396 398 401 402 404 405 405 406 410 411 413 414 415 419 420 421 422 423 424 425 425

x

PowerBuilder

Contents

DeleteCategory ............................................................................ DeleteColumn .............................................................................. DeleteColumns............................................................................. DeleteData ................................................................................... DeleteItem.................................................................................... DeleteItems .................................................................................. DeleteLargePicture ...................................................................... DeleteLargePictures..................................................................... DeletePicture................................................................................ DeletePictures.............................................................................. DeleteSeries................................................................................. DeleteSmallPicture....................................................................... DeleteSmallPictures..................................................................... DeleteStatePicture ....................................................................... DeleteStatePictures ..................................................................... DestroyModel ............................................................................... DirectoryExists ............................................................................. DirList ........................................................................................... DirSelect....................................................................................... Disable ......................................................................................... DisableCommit ............................................................................. DisconnectObject ......................................................................... DisconnectServer......................................................................... Double.......................................................................................... DoVerb ......................................................................................... Drag ............................................................................................. DraggedObject ............................................................................. Draw............................................................................................. EditLabel ...................................................................................... Enable .......................................................................................... EnableCommit.............................................................................. EntryList ....................................................................................... ExecRemote................................................................................. Exp ............................................................................................... ExpandAll ..................................................................................... ExpandItem .................................................................................. Fact .............................................................................................. FileClose ...................................................................................... FileCopy ....................................................................................... FileDelete ..................................................................................... FileEncoding ................................................................................ FileExists...................................................................................... FileLength .................................................................................... FileLength64 ................................................................................

426 427 427 428 429 431 432 432 433 433 434 435 435 436 436 437 437 438 440 441 442 443 444 445 446 447 448 450 451 452 453 454 455 458 459 459 460 460 461 462 463 464 465 466

PowerScript Reference

xi

Contents

FileMove....................................................................................... FileOpen....................................................................................... FileRead....................................................................................... FileReadEx................................................................................... FileSeek ....................................................................................... FileSeek64 ................................................................................... FileWrite ....................................................................................... FileWriteEx................................................................................... Fill................................................................................................. FillA .............................................................................................. FillW ............................................................................................. Find .............................................................................................. FindCategory................................................................................ FindClassDefinition ...................................................................... FindFunctionDefinition ................................................................. FindItem ....................................................................................... FindMatchingFunction .................................................................. FindNext....................................................................................... FindSeries .................................................................................... FindTypeDefinition ....................................................................... FromAnsi...................................................................................... FromUnicode................................................................................ GarbageCollect ............................................................................ GarbageCollectGetTimeLimit ....................................................... GarbageCollectSetTimeLimit ....................................................... GetActiveSheet ............................................................................ GetAlignment ............................................................................... GetApplication.............................................................................. GetArgElement............................................................................. GetAutomationNativePointer........................................................ GetByte ........................................................................................ GetByteArray................................................................................ GetCertificateLabel ...................................................................... GetChildrenList ............................................................................ GetColumn ................................................................................... GetCommandDDE ....................................................................... GetCommandDDEOrigin.............................................................. GetCommandString ..................................................................... GetCompanyName ...................................................................... GetContextKeywords ................................................................... GetContextService ....................................................................... GetCredentialAttribute.................................................................. GetCurrentDirectory ..................................................................... GetData........................................................................................

467 468 471 473 475 477 478 480 482 483 483 483 485 486 487 488 494 496 497 498 500 501 502 502 503 504 505 505 506 507 508 509 509 511 513 514 515 516 517 518 519 520 523 523

xii

PowerBuilder

Contents

GetDataDDE ................................................................................ GetDataDDEOrigin....................................................................... GetDataLabelling ......................................................................... GetDataPieExplode...................................................................... GetDataStyle................................................................................ GetDataTransparency.................................................................. GetDataValue............................................................................... GetDateLimits .............................................................................. GetDbmlsyncPath ........................................................................ GetDisplayRange ......................................................................... GetDynamicDate.......................................................................... GetDynamicDateTime .................................................................. GetDynamicDecimal .................................................................... GetDynamicNumber..................................................................... GetDynamicString ........................................................................ GetDynamicTime ......................................................................... GetEnvironment ........................................................................... GetFileOpenName ....................................................................... GetFileSaveName........................................................................ GetFirstSheet ............................................................................... GetFixesVersion........................................................................... GetFocus...................................................................................... GetFolder ..................................................................................... GetGlobalProperty ....................................................................... GetHostObject.............................................................................. GetItem ........................................................................................ GetItemAtPointer.......................................................................... GetLastReturn.............................................................................. GetLibraryList............................................................................... GetMajorVersion .......................................................................... GetMessage................................................................................. GetMinorVersion .......................................................................... GetName...................................................................................... GetNativePointer.......................................................................... GetNextSheet............................................................................... GetObjectRevisionFromRegistry.................................................. GetOrigin...................................................................................... GetParagraphSetting ................................................................... GetParent..................................................................................... GetPin .......................................................................................... GetRecordSet .............................................................................. GetRemote................................................................................... GetSelectedDate.......................................................................... GetSelectedRange.......................................................................

528 528 530 531 532 538 539 541 542 543 544 546 548 549 550 551 552 553 558 560 561 562 563 564 565 566 569 569 570 571 572 573 574 575 576 577 578 579 579 581 583 584 587 588

PowerScript Reference

xiii

Contents

GetSeriesLabelling ....................................................................... GetSeriesStyle ............................................................................. GetSeriesTransparency ............................................................... GetShortName ............................................................................. GetSpacing .................................................................................. GetStatus ..................................................................................... GetSyncRegistryProperties .......................................................... GetText ........................................................................................ GetTextColor................................................................................ GetTextStyle ................................................................................ GetToday ..................................................................................... GetToolbar ................................................................................... GetToolbarPos ............................................................................. GetTransactionName ................................................................... GetURL ........................................................................................ GetValue ...................................................................................... GetVersionName.......................................................................... Handle.......................................................................................... Hide.............................................................................................. Hour ............................................................................................. HyperLinkToURL.......................................................................... Idle ............................................................................................... ImpersonateClient ........................................................................ ImportClipboard............................................................................ ImportFile ..................................................................................... ImportString.................................................................................. IncomingCallList ........................................................................... Init ................................................................................................ InputFieldChangeData ................................................................. InputFieldCurrentName ................................................................ InputFieldDeleteCurrent ............................................................... InputFieldGetData ........................................................................ InputFieldInsert ............................................................................ InputFieldLocate........................................................................... InsertCategory.............................................................................. InsertClass ................................................................................... InsertColumn ................................................................................ InsertData..................................................................................... InsertDocument ............................................................................ InsertFile ...................................................................................... InsertItem ..................................................................................... InsertItemFirst .............................................................................. InsertItemLast .............................................................................. InsertItemSort...............................................................................

589 590 597 598 599 599 601 602 603 604 605 605 607 610 611 612 613 614 616 617 617 618 619 620 623 627 629 631 634 635 636 637 638 638 640 642 642 643 646 647 648 654 656 659

xiv

PowerBuilder

Contents

InsertObject.................................................................................. InsertPicture ................................................................................. InsertSeries .................................................................................. Int ................................................................................................. Integer .......................................................................................... InternetData ................................................................................. IntHigh.......................................................................................... IntLow........................................................................................... InvokePBFunction ........................................................................ _Is_A ............................................................................................ IsAlive........................................................................................... IsAllArabic .................................................................................... IsAllHebrew .................................................................................. IsAnyArabic .................................................................................. IsAnyHebrew................................................................................ IsArabic ........................................................................................ IsArabicAndNumbers ................................................................... IsCallerInRole............................................................................... IsDate........................................................................................... IsHebrew ...................................................................................... IsHebrewAndNumbers ................................................................. IsImpersonating............................................................................ IsInTransaction............................................................................. IsNull ............................................................................................ IsNumber...................................................................................... IsPreview...................................................................................... IsSecurityEnabled ........................................................................ IsTime .......................................................................................... IsTransactionAborted ................................................................... IsValid .......................................................................................... KeyDown...................................................................................... LastPos ........................................................................................ Left ............................................................................................... LeftA............................................................................................. LeftW............................................................................................ LeftTrim ........................................................................................ LeftTrimW..................................................................................... Len ............................................................................................... LenA............................................................................................. LenW............................................................................................ Length .......................................................................................... LibraryCreate ............................................................................... LibraryDelete................................................................................ LibraryDirectory............................................................................

661 662 663 664 664 666 667 667 668 670 671 672 672 673 674 674 675 676 678 678 679 680 681 682 683 684 685 686 687 688 689 692 694 694 695 695 696 697 698 699 699 700 701 701

PowerScript Reference

xv

Contents

LibraryDirectoryEx........................................................................ LibraryExport ................................................................................ LibraryImport ................................................................................ LineCount..................................................................................... LineLength ................................................................................... LineList......................................................................................... LinkTo .......................................................................................... LoadInk ........................................................................................ LoadPicture .................................................................................. Log ............................................................................................... LogTen ......................................................................................... Long ............................................................................................. LongLong ..................................................................................... Lookup ......................................................................................... Lower ........................................................................................... LowerBound ................................................................................. mailAddress ................................................................................. mailDeleteMessage...................................................................... mailGetMessages ........................................................................ mailHandle ................................................................................... mailLogoff..................................................................................... mailLogon..................................................................................... mailReadMessage ....................................................................... mailRecipientDetails..................................................................... mailResolveRecipient................................................................... mailSaveMessage ........................................................................ mailSend ...................................................................................... Match ........................................................................................... MatchW ........................................................................................ Max .............................................................................................. MemberDelete.............................................................................. MemberExists .............................................................................. MemberRename .......................................................................... MessageBox ................................................................................ Mid ............................................................................................... MidA ............................................................................................. MidW ............................................................................................ Min ............................................................................................... Minute .......................................................................................... Mod .............................................................................................. ModifyData ................................................................................... Month ........................................................................................... Move ............................................................................................ MoveTab ......................................................................................

703 705 706 708 709 710 711 712 713 714 715 716 718 720 725 725 726 728 729 731 731 732 734 736 737 739 742 743 746 747 748 749 750 751 753 755 755 756 756 757 757 759 760 761

xvi

PowerBuilder

Contents

_Narrow........................................................................................ NextActivity .................................................................................. Now .............................................................................................. ObjectAtPointer ............................................................................ Object_To_String ......................................................................... OffsetPos ..................................................................................... Open ............................................................................................ OpenChannel ............................................................................... OpenSheet ................................................................................... OpenSheetWithParm ................................................................... OpenTab ...................................................................................... OpenTabWithParm ...................................................................... OpenUserObject .......................................................................... OpenUserObjectWithParm........................................................... OpenWithParm............................................................................. OutgoingCallList........................................................................... PageCount ................................................................................... PageCreated ................................................................................ ParentWindow.............................................................................. Paste ............................................................................................ PasteLink ..................................................................................... PasteRTF ..................................................................................... PasteSpecial ................................................................................ PBGetMenuString ........................................................................ Pi .................................................................................................. PixelsToUnits ............................................................................... Play .............................................................................................. PointerX ....................................................................................... PointerY ....................................................................................... PopMenu...................................................................................... PopulateError ............................................................................... Pos ............................................................................................... PosA............................................................................................. PosW............................................................................................ Position ........................................................................................ Post .............................................................................................. PostEvent..................................................................................... PostURL....................................................................................... Preview ........................................................................................ Print.............................................................................................. PrintBitmap................................................................................... PrintCancel................................................................................... PrintClose..................................................................................... PrintDataWindow .........................................................................

762 763 765 765 768 769 769 785 787 789 793 796 801 805 809 814 816 816 817 818 820 821 822 823 824 824 825 826 827 828 829 830 832 832 832 838 839 841 843 845 851 852 854 855

PowerScript Reference

xvii

Contents

PrintDefineFont ............................................................................ PrintEx.......................................................................................... PrintGetPrinter ............................................................................. PrintGetPrinters............................................................................ PrintLine ....................................................................................... PrintOpen ..................................................................................... PrintOval ...................................................................................... PrintPage ..................................................................................... PrintRect ...................................................................................... PrintRoundRect ............................................................................ PrintScreen .................................................................................. PrintSend ..................................................................................... PrintSetFont ................................................................................. PrintSetPrinter.............................................................................. PrintSetSpacing ........................................................................... PrintSetup .................................................................................... PrintSetupPrinter.......................................................................... PrintText....................................................................................... PrintWidth..................................................................................... PrintX ........................................................................................... PrintY ........................................................................................... ProfileInt ....................................................................................... ProfileString.................................................................................. Rand............................................................................................. Randomize ................................................................................... Read............................................................................................. Real.............................................................................................. RecognizeText ............................................................................. RegistryDelete.............................................................................. RegistryGet .................................................................................. RegistryKeys ................................................................................ RegistrySet................................................................................... RegistryValues ............................................................................. RelativeDate................................................................................. RelativeTime ................................................................................ ReleaseAutomationNativePointer ................................................ ReleaseNativePointer .................................................................. RemoveDirectory ......................................................................... Repair........................................................................................... Replace ........................................................................................ ReplaceA...................................................................................... ReplaceText ................................................................................. ReplaceW..................................................................................... Reset............................................................................................

856 857 858 859 860 861 862 864 865 866 867 868 870 871 872 873 873 874 876 877 877 878 880 881 882 883 886 887 887 888 889 891 893 893 894 895 896 896 897 898 900 901 902 902

xviii

PowerBuilder

Contents

ResetArgElements ....................................................................... ResetDataColors.......................................................................... ResetInk ....................................................................................... ResetPicture................................................................................. Resize .......................................................................................... Resolve_Initial_References ......................................................... RespondRemote .......................................................................... Restart.......................................................................................... ResumeTransaction ..................................................................... Reverse........................................................................................ RevertToSelf ................................................................................ RGB ............................................................................................. Right............................................................................................. RightA .......................................................................................... RightW ......................................................................................... RightTrim...................................................................................... RightTrimW .................................................................................. RollbackOnly ................................................................................ RollbackTransaction..................................................................... Round........................................................................................... RoutineList ................................................................................... Run............................................................................................... Save ............................................................................................. SaveAs......................................................................................... SaveDocument............................................................................. SaveInk ........................................................................................ Scroll ............................................................................................ ScrollNextPage ............................................................................ ScrollNextRow.............................................................................. ScrollPriorPage ............................................................................ ScrollPriorRow ............................................................................. ScrollToRow ................................................................................. Second ......................................................................................... SecondsAfter................................................................................ Seek ............................................................................................. SelectedColumn........................................................................... SelectedIndex .............................................................................. SelectedItem ................................................................................ SelectedLength ............................................................................ SelectedLine ................................................................................ SelectedPage............................................................................... SelectedStart................................................................................ SelectedText ................................................................................ SelectionRange............................................................................

905 906 907 907 908 909 911 912 912 914 915 916 917 918 919 919 920 920 921 923 924 925 927 930 938 940 942 943 944 945 946 947 948 949 950 952 953 953 954 956 957 958 959 960

PowerScript Reference

xix

Contents

SelectItem .................................................................................... 961 SelectObject................................................................................. 964 SelectTab ..................................................................................... 965 SelectText .................................................................................... 966 SelectTextAll ................................................................................ 970 SelectTextLine ............................................................................. 971 SelectTextWord............................................................................ 971 Send............................................................................................. 973 SeriesCount ................................................................................. 975 SeriesName ................................................................................. 976 SetAbort ....................................................................................... 977 SetAlignment................................................................................ 979 SetArgElement ............................................................................. 980 SetAutomationLocale ................................................................... 981 SetAutomationPointer .................................................................. 982 SetAutomationTimeout................................................................. 983 SetBoldDate ................................................................................. 985 SetByte......................................................................................... 986 SetColumn ................................................................................... 987 SetComplete ................................................................................ 988 SetData ........................................................................................ 991 SetDataDDE................................................................................. 992 SetDataLabelling .......................................................................... 993 SetDataPieExplode ...................................................................... 995 SetDataStyle ................................................................................ 996 SetDataTransparency ................................................................ 1002 SetDateLimits............................................................................. 1004 SetDropHighlight ........................................................................ 1004 SetDynamicParm ....................................................................... 1005 SetFirstVisible ............................................................................ 1006 SetFocus .................................................................................... 1007 SetGlobalProperty...................................................................... 1008 SetItem....................................................................................... 1009 SetLevelPictures ........................................................................ 1012 SetLibraryList ............................................................................. 1013 SetMask ..................................................................................... 1015 SetMessage ............................................................................... 1016 SetMicroHelp.............................................................................. 1017 SetNewMobiLinkPassword ........................................................ 1018 SetNull........................................................................................ 1019 SetOverlayPicture ...................................................................... 1020 SetParagraphSetting .................................................................. 1021 SetParm ..................................................................................... 1022 SetPicture................................................................................... 1023

xx

PowerBuilder

Contents

SetPointer .................................................................................. SetPosition ................................................................................. SetProfileString .......................................................................... SetRange ................................................................................... SetRecordSet............................................................................. SetRedraw ................................................................................. SetRemote ................................................................................. SetResultSet .............................................................................. SetSelectedDate ........................................................................ SetSelectedRange ..................................................................... SetSeriesLabelling ..................................................................... SetSeriesStyle............................................................................ SetSeriesTransparency.............................................................. SetSpacing................................................................................. SetState ..................................................................................... SetSyncRegistryProperties ........................................................ SetTextColor .............................................................................. SetTextStyle............................................................................... SetTimeout................................................................................. SetToday.................................................................................... SetToolbar.................................................................................. SetToolbarPos ........................................................................... SetTop........................................................................................ SetTraceFileName ..................................................................... SetTransPool ............................................................................. SetValue..................................................................................... SharedObjectDirectory............................................................... SharedObjectGet ....................................................................... SharedObjectRegister................................................................ SharedObjectUnregister............................................................. Show .......................................................................................... ShowHeadFoot .......................................................................... ShowHelp................................................................................... ShowPopupHelp ........................................................................ Sign ............................................................................................ SignalError ................................................................................. Sin .............................................................................................. Sleep .......................................................................................... Sort............................................................................................. SortAll......................................................................................... Space ......................................................................................... Sqrt............................................................................................. Start............................................................................................ StartHotLink ...............................................................................

1024 1026 1028 1030 1030 1032 1032 1035 1036 1037 1038 1039 1046 1048 1049 1050 1051 1051 1052 1054 1055 1057 1061 1061 1063 1063 1065 1065 1069 1070 1070 1071 1072 1074 1075 1075 1076 1077 1077 1079 1080 1081 1082 1089

PowerScript Reference

xxi

Contents

StartServerDDE ......................................................................... State........................................................................................... StepIt.......................................................................................... Stop............................................................................................ StopHotLink................................................................................ StopServerDDE.......................................................................... String.......................................................................................... String_To_Object ....................................................................... SuspendTransaction .................................................................. Synchronize ............................................................................... SyntaxFromSQL......................................................................... SystemRoutine ........................................................................... TabPostEvent............................................................................. TabTriggerEvent ........................................................................ Tan ............................................................................................. Text ............................................................................................ TextLine ..................................................................................... Time ........................................................................................... Timer .......................................................................................... ToAnsi ........................................................................................ Today ......................................................................................... Top ............................................................................................. TotalColumns ............................................................................. TotalItems .................................................................................. TotalSelected ............................................................................. ToUnicode.................................................................................. TraceBegin................................................................................. TraceClose................................................................................. TraceDisableActivity................................................................... TraceEnableActivity ................................................................... TraceEnd.................................................................................... TraceError .................................................................................. TraceOpen ................................................................................. TraceUser .................................................................................. TriggerEvent............................................................................... TriggerPBEvent .......................................................................... Trim ............................................................................................ TrimW......................................................................................... Truncate ..................................................................................... TrustVerify.................................................................................. TypeOf ....................................................................................... Uncheck ..................................................................................... Undo........................................................................................... UnitsToPixels .............................................................................

1091 1092 1093 1094 1095 1096 1097 1103 1106 1107 1108 1112 1113 1114 1115 1115 1116 1117 1120 1121 1121 1122 1123 1124 1124 1125 1126 1127 1128 1130 1131 1132 1133 1135 1136 1138 1140 1141 1141 1143 1146 1147 1149 1149

xxii

PowerBuilder

Contents

UpdateLinksDialog ..................................................................... Upper ......................................................................................... UpperBound ............................................................................... Which ......................................................................................... WordCap .................................................................................... WorkSpaceHeight ...................................................................... WorkSpaceWidth ....................................................................... WorkSpaceX .............................................................................. WorkSpaceY .............................................................................. Write........................................................................................... XMLParseFile............................................................................. XMLParseString ......................................................................... Year............................................................................................ Yield ...........................................................................................

1150 1152 1152 1154 1156 1156 1158 1158 1159 1160 1161 1165 1168 1169

Index ......................................................................................................................................... 1173

PowerScript Reference

xxiii

Contents

xxiv

PowerBuilder

About This Book

Audience How to use this book

This book is for programmers who will use PowerBuilder to build client/server or multitier applications. This book describes syntax and usage information for the PowerScript language including variables, expressions, statements, events, and functions. For a complete list of PowerBuilder documentation, see the preface of the PowerBuilder Getting Started book. Use the Sybase Getting Started CD, the SyBooks CD, and the Sybase Product Manuals Web site to learn more about your product: The Getting Started CD contains release bulletins and installation guides in PDF format, and may also contain other documents or updated information not included on the SyBooks CD. It is included with your software. To read or print documents on the Getting Started CD, you need Adobe Acrobat Reader, which you can download at no charge from the Adobe Web site using a link provided on the CD. The SyBooks CD contains product manuals and is included with your software. The Eclipse-based SyBooks browser allows you to access the manuals in an easy-to-use, HTML-based format. Some documentation may be provided in PDF format, which you can access through the PDF directory on the SyBooks CD. To read or print the PDF files, you need Adobe Acrobat Reader. Refer to the SyBooks Installation Guide on the Getting Started CD, or the README.txt file on the SyBooks CD for instructions on installing and starting SyBooks. The Sybase Product Manuals Web site is an online version of the SyBooks CD that you can access using a standard Web browser. In addition to product manuals, you will find links to EBFs/Maintenance, Technical Documents, Case Management, Solved Cases, newsgroups, and the Sybase Developer Network. To access the Sybase Product Manuals Web site, go to ProductManuals at http://www.sybase.com/support/manuals/.

Related documents Other sources of information

PowerScript Reference

xxv

Conventions

The formatting conventions used in this manual are:Formatting exampleRetrieve and Update

Indicates When used in descriptive text, this font indicates: Command, function, and method names Keywords such as true, false, and null Datatypes such as integer and char Database column names such as emp_id andf_name

User-defined objects such as dw_emp orw_main

variable or file name

When used in descriptive text and syntax descriptions, oblique font indicates: Variables, such as myCounter Parts of input text that must be substituted, such as pblname.pbd

File>Save

dw_1.Update()

File and path names Menu names and menu items are displayed in plain text. The greater than symbol (>) shows you how to navigate menu selections. For example, File>Save indicates select Save from the File menu. Monospace font indicates: Information that you enter in a dialog box or on a command line Sample script fragments Sample outpu