Home

AP Basic Programming Guide

image

Contents

1. 0 Ga oO De 0 o G 5 O c G N Example Example Output Keywords Empty False Nothing Null True Win16 Win32 Word Description Empty A variantvar that does not have any value False A condexpr is false when its value is zero A function that returns False returns the value 0 Nothing An objexprthat does not refer to any object Null An variant expression that is null A null value propagates through an expression causing the entire expression to be Null Attempting to use a Null value as a string or numeric argument causes a run time error A Null value prints as NULL Sub Main X Nul Debug Print X Null even this expression is Null Debug Print IsNull X use IsNull to test for a _ Null End Sub Null True True Winl6 Win32 value A conditional expression is true when its value is non zero A function that returns True returns the value 1 True if running in 16 bits False if running in 32 bits True if running in 32 bits False if running in 16 bits Page 7 6 APWIN BASIC User s Guide and Language Reference Version 2 Abs Chapter 7 Language Commands Language Commands amp m EN Abs Function E o Syntax Abs num Ee O Parameters Name Description o num Return the absolute value of this number value Description Return the absolute value Q Example Sub Main Debug Print Abs 9 Debug Print Abs 0 Debug Print
2. OPErators ani a Scat ech ce Fen ner es Ro hte Bek i 7 3 Data TYDES o ida ae ee eae Baer eta oe de Se ee 75 KEVWOIOS ae used Sa we che wb eee ds A e da ed 7 6 Language Commands radade deep rr 7 7 ADS ce ye ee a hee eh ety lt b kee ce Je a 7 7 AppActivate eee ewe e ea See ees 7 7 APTA Dino Se Bach Gee Se ed Sh ee a a ee ee E 7 8 ASO ra Oe eee eet Pala ate oles ce ks eens Ghee Wet Guten no 7 8 Cece cante hogs Gad E E A Oe eS 7 9 Attribute a 7 9 BGD a e oe e eo a we ee ee ei ee 7 10 Begin Dialog a a aL 7 10 CANN cis tee cee testes Leda Lea 7 11 CalIByName a 7 12 CallersLine 000000000000000 7 12 CancelButton Dialog Item 7 13 CBOOl 24 2 06 66 oe Bee eee eee oe ee bene Bee 7 14 CRV dois en a ee te n 7 15 CCU aer aaa dad as ini 7 15 O Se Rak RR Stk 7 15 ODDI ii oe Glas bt cl edt aw ews ene ar ene Beet a eit Bee 7 16 CODI rela es ee ee n 7 16 CODPIVE ini een es 7 17 Page 2 APWIN BASIC User s Guide and Language Reference Version 2 CONTENTS CNECKBOX 2 cate i I e ae Bi ree hee ls 7 17 Choose Le 7 18 CHES cigni ee oe Pee a os ee we ee E 7 19 CINE es ce ide Se aoe ae ous Ba ee a oe se 7 19 A nt Ri A a 7 20 Class_Initialize cra a e Pe EES 7 21 Class_Terminate oa RE TA 7 21 CIDO STO ia gt de re e e a ae 7 22 CLNG e id a ee ee ee ee e ais de ls 7 22 CIOSO coi ue Doro aces ee coe dia de boda 7 23 COCO un a le Ge
3. Abs 9 End Sub Example Output 9 0 9 AppActivate Instruction Syntax AppActivate titles OY AppActivate TaskID Parameters Name Description titles The name shown in the title bar of the window TaskID This numeric value is the task identifier Description Form 1 Activate the application top level window titled Title If no window by that title exists then the first window with at title that starts with Title is activated If no window matches then an error occurs Form 2 Activate the application top level window for task TaskID If no window for that task exists then an error occurs APWIN BASIC User s Guide and Language Reference Version 2 Page 7 7 TimeValue Chapter 7 Language Commands See Also Example Example Output TimeValue Syntax Parameters Description See Also Example Example Output Trim Syntax Parameters Description See Also Example DateSerial DateValue TimeValue Il Sub Main 2 Debug Print TimeSerial 13 30 0 Ce E End Sub y to 1 30 00 PM O A 0 h 0 z 0 Function E e 0 TimeValue dateS Name Description dates Convert this string value to the time part of date it represents Return the time part of date encoded as a string value DateSerial DateValue TimeSerial Sub Main Debug Print TimeValue 1 1 2000 12 00 01 AM End Sub 12 00 01 AM Function Trim strings Name Description strings Copy this s
4. Result Value Description Empty Variant variable is empty It has never been assigned a value Null Variant variable is null Integer Variable contains an integer value Long Variable contains a long value Single Variable contains a single value Double Variable contains a double value Currency Variable contains a currency value Date Variable contains a date value String Variable contains a string value Object Variable contains a object reference that is not Nothing An object may return a type name specific to that type of object Nothing Variable contains a object reference that is Nothing Error Variable contains a error code value Boolean Variable contains a boolean value Variant Variable contains a variant value Only used for arrays of variants Unknown Variable contains a non OLE Automation object reference Byte Variable contains a byte value Variable contains an array value The TypeName of the element followed by Description Return a string indicating the type of value stored in var See Also VarType Example Sub Main Dim X As Variant Debug Print TypeName X X 1 Debug Print TypeName X APWIN BASIC User s Guide and Language Reference Version 2 Page 7 155 Audio Precision Inc PO Box 2209 Beaverton Oregon 97075 2209 Audio U S Toll Free 1 800 231 7350 Tel 503 627 0832 Fax 503 641 8906 Ie Ision email A O Web www audioprecision com Audio precision Audio Prec
5. eaa i a Res See ee se RS OER Ea 7 113 Object Terminate SUD s ss s soe LA soaa a a ae ed Es 7 113 DOES to er pros ee B S gt doe ds Ga ee a Oe me 7 114 OKBUCTON Dialog KEM Lia ES SOS ES 7 114 ON EMOT 25 4 6 oa dita HESS 7 115 OPEN 6 a dae oe OS DO oO a ea be ee Oe a 7 116 OPTION s sopis wade d oe e i 7 117 OptionButton Dialog ITEM crisis AA 7 117 OPUIONGIOUD a ao a ia a e e ld basoa eS Se 7 118 POW 645 4d ew ERRE ERR HER 7 119 Picture Dialog Item ot ete See pe hee eee CRS SRS 7 119 POWETRATIOTOOB ss rea eed oe ei E e a 7 121 PANC a ui Be ace Bm a o fae ew ag 7 121 PIEL wr iano gia Cela a i he Sek aaa 7 122 PIWAte o spet a i AAA SESE 7 122 Property scsi oe e ep ee a E See a 7 122 PUBIC a i s oc ais 6 et oe aa AAA 7 124 PUDIIC lt 4 ate ee es ee ok hs ee Se ee E Be 7 124 PushButton Dialog Item 2 5 4 are a0 care wee e Se Sty Se 7 124 PUC out ew ew ee e ow ee A E 7 125 QBCO IOF 0 guess deaa eee eee SS Cee SES Ew Oe e a 7 126 RANGOMIZE 3 a saare See Lea 7 128 REDIMI 2 ra Ste a ae a aa 7 128 Ai o eai soaa ii ge Bra e aa Da 7 129 REM sa oy ae a a ok ee Cd Dw BH wy Be we BS ae a Se ad 7 129 REDIACE es S iy EN DRS ER e HS Sa DE eH SH 7 130 RESCEs lt span Ghent a de oe Ca ea AD 7 130 RESUME lt lt SR rss A Ok Bee a AR Bares 7 131 ROB oh sala sn RA Sia eo Ee Eee RR 7 132 RGN qe entras pie e e a bee eee ee ae A 7 132 RMDP 5 244 24 eri CE we See a a 7 133 RAG ar deca A a tae eae ow ee Re Be 7 133 ROUNO cuce eS pea A AA
6. ee ee ee 7 23 COMDOBOX LL 7 23 Commands os e oae a e de A a G a a 7 25 CONSE z ea e es ee ee RS Oe eee ee eee es 7 25 COS eo ce es ee eee ee een te vel ten da ee ae ei Te 7 26 CreateObject 0 0 00 a 2 ee 7 26 EMO se pulire ok eh a sg es ee Se er 7 27 COP een 7 27 CUPDIFS sauri rate SG E a eR 7 28 Valea aia dra n bi de oe 7 28 CVEN Ts sue mas e a Oe da aaa pa aa eee a 7 29 Dates ie Ba ss a a a ee edt Sit ie de a n ea 7 29 DAteAdO lt b se ee ek we e a hw ere tk a eee A 7 30 DateDitt ei i wow be SS ee Oe oe bh be eee eee Se 7 31 DatePare soglia ae Se hs See ete e data 7 31 DateSerial 2c 2622842480546 ood dwt eso a 7 32 Datevalue 2 a a a a a 7 33 Divieti E E use e ee E 7 33 dBToPowerRatio a a 7 34 dBToVoltageRatio a a ee 7 34 DDEEXCCULCG i c esaa a aeaea aS A a a a 7 35 DDElnitiate ir a Go oe ee E i 7 35 DDEPoke renr rareunua 7 36 DDEREQUESTS a a 7 36 DDETErminate 0 0 0 a 008 eee a ee 7 37 DDETErminateAll ecc sus lle aR ERR A 7 37 DEDUO Ri eros ie 0k Gk ee A Se a N 7 38 Declare sh oe cee ey te ee Ls ee e eee ee ee 7 38 DOE cos e Pene sy ee Sh et dle daa a 7 39 DeleteSetting 00000000000 000 2 eee eee 7 41 DIAIOO i i aa See oe here Ge ee o de a Gee E 7 41 Dialog FUNC ita ese teres age e lat Silas ta eG ia a 7 42 DIM acento Beck tines Ged n oh Go dde I a oe es 7 44 APWIN BASIC User s Guide and Language Reference Version 2 Page 3 CO
7. wo ca BE ee ee 7 73 FreeFil sego lega Sie a a wee ee SRR Se ww BSNS wd 7 77 FUNCION las Me a We we ek n ek da aha 7 78 Gel pci otek ey te eae hn ae e ae ee 7 79 GetallSettings 0 00 00 00 00 000000000 2 ee 7 80 GOTATC rosa letra e Bie orale 7 80 GetFilePatn o 7 81 GELODICCE se es e a aaa ia ai a arca a 7 82 Getsettina 00 00 00 000 eee 7 82 Page 4 APWIN BASIC User s Guide and Language Reference Version 2 CONTENTS o oY a a ite E A 7 83 GroupBox Dialog IlteM 7 83 HEXS 05 o pm a See ea ee e aa i 7 84 HOU iaa eS a See ee es a oa ee See 7 85 fesa dea a e i 7 85 Roe e e an ge ee ek a 7 86 WVU sete lt a e sob a mb wen e i hah obs Race a be G 7 86 INPUES eve a ae en a ew ee E 7 87 INDUTBOXS e seraa seee EGS eS eS Ode Ee he eee BS 7 88 WASSUP cs cis rea See Od ee i ee ee ees Des oe Ace Soe ee Bas eee 7 88 InStrReV 2 ee 7 89 WN es tees a o oo hs e e ee by ee ee BR Se eg 7 89 ist int e a o o ee ee es ein 7 90 AF ali lie 7 90 ISD Ate cauces aia enna ni 7 91 El e ene i ak ae EG e e ee he Be oe 7 91 DECOR pa Woe Be See en ae oe a 7 92 ISMISSINO ila Bs A Stes E Se do wra 7 93 ENUI ess in BS ee A a Ge Go ee 7 94 PSN Gs sane e e Bee oe ae a n 7 94 BODE a sx ck oe rene Ole doe be he be EG late n 7 95 lisas ar Be aw ee a Se ae ER 7 96 UU 2 425 foes cw to Ge wood ene ian tee Se eee ee 7 96 LCASES 3 3 veh b hha a eA See SE we bow a Sos 7 97 GEES consi le c
8. APWIN BASIC USER S GUIDE AND LANGUAGE REFERENCE Audio precision APWIN BASIC User s Guide and Language Reference Version 2 August 1999 APWIN Basic User s Guide and Language Reference Copyright 1993 1999 Audio Precision Inc All rights reserved Version 2 August 1999 Language Reference Documentation Copyright 1993 1999 Polar Engineering and Consulting All rights reserved No part of this manual may be reproduced or transmitted in any form or by any means electronic or mechanical including photocopying recording or by any information storage and retrieval system without permission in writing from the publisher Audio Precision System One System One DSP System Two FASTTEST APWIN Portable One and Dual Domain are registered trademarks of Audio Precision Inc Windows is a trademark of Microsoft Corporation Published by Audio Precision Inc PO Box 2209 Beaverton Oregon 97075 2209 ul 10 U S Toll Free 1 800 231 7350 Tel 503 627 0832 Fax 503 641 8906 F N email techsupport audioprecision com Web www audioprecision com Printed in the United States of America Audio Precision Part 8211 0089 CONTENTS Introduction ile e ew e a 1 APWIN Basic User s Guide and Extension Manuals 1 2 Manual Conventions 5 eat wos ee eek e aia oi di 1 3 A Few Words About Terminology 1 4 Where to Find Sample Files and Example
9. DatePart DateSerial DateValue Day Hour Minute Month MonthName Now Second Time Timer TimeSerial TimeValue Weekday WeekdayName Year APWIN BASIC User s Guide and Language Reference Version 2 Page 7 1 Chapter 7 Groups DropListBox GroupBox ListBox OKButton OptionButton OptionGroup Picture PushButton Text TextBox Dialog Function Dialog Func DlaControlld DigCount DlgEnable DlgEnd DlgFocus DlgListBoxArray DigName DigNumber DlaSetPicture DigText DigType DigValue DlgVisible roy File ChDir ChDrive Close CurDir Dir EOF FileAttr FileCopy FileDateTime FileLen FreeFile Get GetAttr Input Input Kill Line o Input Loc Lock LOF MkDir Name Open Print Put Reset RmDir g Seek Seek SetAttr Unlock Write 0 4 User Input Dialog GetFilePath InputBox MsgBox 0 2 User Dialog Begin Dialog End Dialog CancelButton CheckBox ComboBox te i G ml N DDE DDEExecute DDEInitiate DDEPoke DDERequest DDETerminate DDETerminateAll Settings DeleteSetting GetAllSettings GetSetting SaveSetting Miscellaneous AppActivate Attribute Beep CallersLine Choose Clipboard Command Debug Print DoEvents Environ IIf MacroDir QBColor Rem RGB SendKeys Shell Wait WaitAndDoEvents Operator Operators Mod amp lt gt lt gt lt gt Like Not And Or Xor Eqv Imp Is Page 7 2 APWIN BASIC User s Guide and Language
10. NTENTS DIPS ee asec oe eae te Be a re oe n a asa ee 7 45 DigControlld LL 7 45 DIGCOURNE o 20 Sees oe he ree e re te SH 7 46 DIGENADIE s gaad e eink ra hee ape ae eo a SLE 7 47 DISENO a atar ano ds oe od Ae ene ees 7 48 DIQFOCUS cias oe a fee ted KE Aad we odd eH a chee Bela Ge we D 7 49 DigListBoxArray 0 2 a 7 50 DIGNaMe 20 3 gt te Be ee ee o a e a reece ew ee 7 52 DigNumber LL 7 53 DIGSCEPICUUG cio ra A a aE eet ee 7 54 DIOTEXE li a ee ad Ga eee whe Gh de ra es n BB 7 55 DIOTYDO e ueue e Se we A we e we we we 7 56 DIOVallO a oe ae Se es he E es ce e St a 7 57 DIGVISIDIE lt a s c st ee Hwee we bee E SEE ware 7 59 DO joke sensi Agus i he ee Br ete aie RR Gees te 7 60 DoEventSs LL 7 61 DropListBox 0 0 00 000 ee ee 7 61 ENO ii fee Gow Be oe i 7 62 EMUM sio ene ea Ble a os Sew ee es oa Be 7 63 ENVIFON coglie Ge Seeks n Paes lie ts nee 7 64 EOE aa Sh A Oe Se be he te Eee ae bane 7 64 Elden he ts cae og es ost a md ine see es A 7 65 EGR gee es ae eee ce we e ee Be eee 7 65 EON gt dau Gok oo Bee See et ee a r da da ds a 7 66 EX a ao at ae a a ea ee a nd 7 66 EX Da ma ahh ace ae ate on oA a a E 7 68 EXD10 au he Se a ae Fe ok A eee ote i Se ok ae geo a en 7 68 FileAttr ie A RR woe I 7 69 FileCopy LL 7 69 FileDateTime 0 0 000002 a 7 70 ICL ON o sa eo in do ee eS a E ie e 7 70 Fosse a ae oe rt e GaAs 7 71 FOR Rete n a de 7 71 For Each 2 0 0 0 ee 7 72 FORMAUS on ast os we ee a BH Ge Se
11. PWIN BASIC User s Guide and Language Reference Version 2 Chapter 7 Introduction Declaration Assignment Flow Control Error Handling Conversion Variable Info Math String Object Time Date Reference Uses Attribute Class Module Code Module Const Declare Deftype Dim Enum End Enum Function End Function Object Module Option Private Property End Property Public ReDim Static Sub End Sub Type End Type WithEvents Erase Let LSet RSet Set Call CallByName Do Loop End Exit For Next For Each Next GoTo If Elself Else EndIf MacroDir MacroRun MacroRunThis Select Case End Case Stop While Wend Language Reference E EY Introduction a a O A O Groups Fy D 3 0 Err Error On Error Resume Array CBool CByte CCur CDate CDbl CInt CLng CSng CStr CVar CVDate CVErr Val IsArray IsDate IsEmpty IsError IsMissing IsNull IsNumeric IsObject LBound TypeName UBound VarType Abs Atn Cos dBToPowerRatio dBToVoltageRatio Exp Exp10 Fix Int Log Log10 Pow PowerRatioTodB Randomize Rnd Round San Sin Sqr Tan VoltageRatioTodB Asc AscB AscW Chr ChrB ChrW Format Hex InStr InStrB InStrRev LCase Left LeftB Len LenB LTrim Mid MidB Oct Replace Right RightB RTrim Space String Str StrComp StrReverse StrConv Trim UCase CreateObject GetObject Me With End With Date DateAdd DateDiff
12. Reference Version 2 Chapter 7 Operators Operators Ku 9 Syntax Not Mod amp lt lt gt gt lt gt Is And Or Xor E Eqv Imp 5 Description These operators are available for numbers n1 and n2 or strings s1 and s2 If any value in an expression is Null then the expressions value is ke Null The order of operator evaluation is controlled by operator D precedence 0 Operator Description n1 Negate n1 pi n2 Raise n1 to the power of n2 nl n2 Multiply n1 by n2 nl n2 Divide n1 by n2 nl Y n2 Divide the integer value of n1 by the integer value of n2 nl Mod n2 Remainder of the integer value of n1 after dividing by the integer value of n2 nl n2 Add n1 to n2 si s2 Concatenate s1 with s2 ni n2 Difference of n1 and n2 sl amp s2 Concatenate s1 with s2 nl lt n2 Return True if n1 is less than n2 ni lt n2 Return True if n1 is less than or equal to n2 nl gt n2 Return True if n1 is greater than n2 nl gt n2 Return True if n1 is greater than or equal to n2 nl n2 Return True if n1 is equal to n2 nl lt gt n2 Return True if n1 is not equal to n2 sl lt s2 Return True if s1 is less than s2 sl lt s2 Return True if s1 is less than or equal to s2 sl gt s2 Return True if s1 is greater than s2 sl gt s2 Return True if s1 is greater than or equal to s2 sl s2 Return True if s1 is equal to s2 sl lt gt s2 Return True if s1 is not equ
13. al to s2 Not nl Bitwise invert the integer value of n1 Only Not True is False nl And n2 Bitwise and the integer value of n1 with the integer value n2 nl Or n2 Bitwise or the integer value of n1 with the integer value n2 APWIN BASIC User s Guide and Language Reference Version 2 Page 7 3 o 19 c fo Sa 0 Gen oO oe 0 D G 5 o c G N Chapter 7 Operators nl Xor n2 ni Eqv n2 ni Imp n2 Example Sub Main N1 1 Koo o e e o e e e e e e e e e e e e o e e e O e e R QQ Bitwise exclusive or the integer value of n1 with the integer value n2 Bitwise equivalence the integer value of n1 with the integer value n2 same as Not n1 Xor n2 Bitwise implicate the integer value of n1 with the integer value n2 same as Not n1 Or n2 0 asdfg h3k1 Print N1 10 Print N1 N2 1000 Print Not N1 11 Print N1 N2 30 Print N1 N2 r 323333333339333 Print N1 N2 ee Print N1 Mod N2 1 Print N1 N2 13 Print S1 S2 asdfghjk1 Print N1 N2 Lr Print N1 amp N2 gs Print N1 lt N2 False Print N1 lt N2 False Print N1 gt N2 True Print N1 gt N2 True Print N1 N2 False Print N1 lt gt N2 True Print S1 lt S2S True Print S1 lt S2 True Print S1 gt S2 False Print S1 gt S2 False Print S1 S2 False Print S1 lt gt S2 True Print N1 And N2 2 Print N1 Or N2
14. ale ene aa Gs ae Ae edu as ft Spee Seeds a ar Gp ads de oh aes 7 159 VarTyD pc o al e ee ak Be a we A e a data ee we 7 159 VoltageRatioTOdB 0200000 eee eee 7 161 Wali cts Soot ee ner 7 161 WaitAndDoEvents 0000 eee ee eee eee 7 161 WECKGAY in ahi er te ees egg ak Eee tat estes RUE ae te ee 7 162 WeekdayName 0 0 0000 0b eee ee ee eee 7 163 APWIN BASIC User s Guide and Language Reference Version 2 Page 7 CONTENTS WINE ite ee eee da Ms we Oe i es cd ae 7 163 Willis sasso ta ye ee ae Sec Sos o_o eG te ete ee dw Aa 7 164 WithEvents es i eua nieee a o a a a 7 164 WICE ara a Be we oe i Boa a a E as 7 165 VOOR iaia Gn Ge es e SR n 7 165 Appendix A Terms o A Appendix B Error List o o o 2c eee B Page 8 APWIN BASIC User s Guide and Language Reference Version 2 Chapter 1 Introduction Welcome to the APWIN BASIC User s Manual and Programmers Reference your guide to creating custom test programs for Audio Precision s System One System Two and System Two Cascade platforms referred to collectively as System throughout this Guide APWIN Basic is a powerful and easy to use programming language compatible with Microsoft s Visual Basic for Applications In this book you ll learn how to create APWIN Basic programs i e macros that can load and run tests automate repetitive tasks and add custom features and f
15. cade Chapter Overviews E Chapter 1 provides an overview of APWIN to help the first time user get started quickly The first time user should review this chapter before continuing Page 1 2 APWIN BASIC User s Guide and Language Reference Version 2 Chapter 1 Manual Conventions E Chapter 2 provides an introduction to the fundamentals of APWIN Basic Several of the key concepts in Visual Basic are introduced including objects methods and properties and the use of macros E Chapter 3 moves beyond the concepts of Visual Basic and jumps into the basics of writing a program Working from a simple example each of the key elements of a program is introduced and discussed Some of the key topics discussed in this chapter include the structure of a program syntax and an introduction to commonly used commands my 5 et o 2 lt le O 5 E Chapter 4 describes how to test and debug a program APWIN Basic provides a number of tools to assist in verifying correct operation of a program Additional topics include tips for simplifying the debugging process common programming mistakes to avoid and error handling E Chapter 5 provides an introduction to the APWIN Basic Dialog Editor The Dialog Editor provides an easy way of creating a user interface consisting of menus and other dialogs that an operator can interact with to control your program E Chapter 6 provides an introduction and an example of how to interact wi
16. e ca ea see te Bs 7 97 LEN wethee et oe eee dee ee Se bl eee Oe ee ee ee ee 7 98 OT vince ae ae Ge eee ec ee A ani es es Gs Se es eee i 7 98 Uke RR e GER She oat estan Boas i 7 98 Line Input pupilla eee ee eS 7 99 ListBox Dialog IteM RTRT ek oa HS ESE Oe REO eS SESS 7 99 LOG ia ie Be eee lee She ot Bes ale ie eee e 7 100 LOCK recs ee nei ake cheese woods Gp Un oc n ae GA 7 101 LOR eee ea ee ee oe a Ser te E ee Sys Wy ee Se a n 7 102 LOQ ca ec eee ae ee sy e Gots a Ge ah Wo ae eee al e ee 7 102 LOOTO ecc ies oe a ee ees eee ee Se ee ees 7 103 SOU amp bcs ace Mas we OG E oe aw Bilas woth 7 103 EIMS aisha Be ss ee we es ge es ee ee ee ee A 7 104 MacroDir oroe cm e oe aa a e a e a e a a a O i 7 104 MaCrORUN as a atra vee ae ea 7 105 MacroRunTh S lt gt aoaaa aaa e sr 7 105 WAI ks e o oe E Seo E E LS wt E E ee es ee ds 7 106 Mess care ERRE Sila ne ge ete Ee ed eet e Nea io eh 7 106 MIOS a ei eins Wek ue ao de hand oh hbo a 7 107 APWIN BASIC User s Guide and Language Reference Version 2 Page 5 CONTENTS MINUTE acs og Bh sa he ca is ee Be ee deca ae eh ae i e Se 7 108 MIRO hw sto ee Peet i ee a E e 7 108 MONO lt gt rra da are ESSE ew OSE e oe GX 7 109 MONTNNAME gt lt br ar A o ea Sie he E a 7 109 MSIBOX san ad A a daa Se OS A A 7 110 NAMES pese Re ce A ed De ae 7 111 NOW c e mop ace al morass d mye d adi e e i aee a aea ON Owe La 7 111 OCS carr AAA a 7 111 ODJECE osos ra AAA 7 112 ODIECU NitialiZe SUD gt eor
17. erful programs APWIN BASIC User s Guide and Language Reference Version 2 Page 1 1 Chapter 1 APWIN Basic User s Guide and Extension Manuals APWIN Basic User s Guide and Extension Manuals The following are descriptions of the APWIN Basic User s Guide and Language Reference and the Basic Extension Reference manuals for each hardware platform APWIN Basic User s Guide and Language Reference This book provides an introduction to programming in APWIN Basic It is intended as a tutorial to help beginning users understand what APWIN Basic is and how to use it to develop programs Depending on your experience programming with Visual Basic you may want to read some or all of these introductory chapters Section One is covered in chapters 1 6 S 2 19 ko ES 43 Chapter 7 is organized as a Language Reference and lists the generic commands available in APWIN Basic These are the same commands you will find available in any Visual Basic compatible application APWIN Basic Extensions Extensions to the commands found in chapter 7 of this User s Guide are located in specific Extension Reference manuals Extension commands are used to control the operation of APWIN and specific Audio Precision System hardware These Extension Reference manuals are APWIN Basic Extensions Reference for System One APWIN Basic Extensions Reference for System Two APWIN Basic Extensions Reference for System Two Cas
18. ision PO Box 2209 Beaverton Oregon 97075 2209 Tel 503 627 0832 Fax 503 641 8906 US Toll Free 1 800 231 7350 email techsupport audioprecision com Web www audioprecision com
19. me aa Print N1 Xor N2 9 Print N1 Egv N2 10 Print N1 Imp N2 9 Page 7 4 APWIN BASIC User s Guide and Language Reference Version 2 Chapter 7 Data Types Ni DI e D Q A h 5 lo O Data Types Any Boolean Byte Currency Date Double Integer Long Object Single String String n Variant user type Type Description Any Any variable expression Declare only Boolean A True or False value Byte An 8 bit unsigned integer value Cdec Convert a number or string value to a 96 bit scaled real Currency A 64 bit fixed point real A twos complement binary value scaled by 10000 Date A 64 bit real value The whole part represents the date while the fractional part is the time of day December 30 1899 0 Use date as a literal date value in a macro Double A 64 bit real value Integer A 16 bit integer value Long A 32 bit integer value Object An object reference value see Objects PortInt A portable integer value For Win16 A 16 bit integer value For Win32 A 32 bit integer value Single A 32 bit real value String An arbitrary length string value String n A fixed length n string value UserDialog A usertype defined by Begin Dialog UserDialog Variant An empty numeric currency date string object error code null or array value APWIN BASIC User s Guide and Language Reference Version 2 Page 7 5 Chapter 7 Keywords o 19 c 10 Sa
20. pe E a 7 134 ROSE E hee Spite Ged i an de es rd E 7 134 Page 6 APWIN BASIC User s Guide and Language Reference Version 2 CONTENTS RIFMIMS eee e be eee Ese wh ce ar Jb tech nay abet Ws ated aed e Ana Oe it 7 135 SaveSetting aoaaa a a 00000000002 eee eee 7 135 SECONO e bec ica ee a ee aeaa a e e 7 136 SOCK cis e E E E a R E E E a Ba eek 7 136 See ato E E Lat E I ey et ee A ne 7 137 Select ase 7 137 SendKeys LL 7 138 Sel igiene ni 7 140 SELAT dato ila he n 7 141 SON soia e n e Beste a 7 141 Shell iso sea ee nn e ney ea 7 142 SIN eran anna ni 7 142 SPACES ue e eo ee 7 143 SO cile E ee Le in 7 143 Stato carni Aaa i re ran 7 144 lA e a oe 7 144 SOURS oan ere e tes es Gd ee n 7 145 SEFCOMPS ile 7 145 SUPCONVS end RS eh RA ERE amp S 7 146 SUPREVERSES sti daa o io ee A era ds Gres ee ide a 7 147 SENOS a are te ae ee ee oe ae ee Bo eens ds A e 7 147 SUD crea Ret eee ces reni 7 148 Tani a ai Eee ee le Ge n e ee bees 7 149 Text Dialog Item es RAIL 7 150 TextBOX Dialog Mea dene he ak awe BS Ow Goes a HR R a 7 151 Messi iii e era 7 152 TG ode ri ae e ae Gade E 7 152 Timesertali ss eee Se a wba e I ete 7 152 TimeValue Lira rc e Gest e Rte 7 153 TWAS nn 7 153 TYDE e visse iena nd ble ae nt 7 154 TypeName ras RR aa 7 155 UBOUNA vino ee wave er ad Sh ea Be ii Ryde a id ee e ee 7 156 UCaseS 2 ww aaa a a a a a 7 157 UNIOCK Bu oh oe ee a ia Se i 7 157 USES ieee Sle ee Shee ee a ee ee e as ee 7 158 V
21. rm has in fact been used for many years in the industry to generally describe the process of performing one or more tests and or measurements A Test Procedure has described what to measure how to measure it what equipment to use and other details that a technician would need to know to carry out the task in a consistent fashion that meets the objectives of the test Programmers have also used the word Procedure for several years to identify specific programs or parts of programs In particular Visual Basic and Applications Basic uses the term Procedure to mean a specific part of a program Unfortunately this use of the word is at odds with the testing industry use of the term Procedure as described Page 1 4 APWIN BASIC User s Guide and Language Reference Version 2 Chapter 1 A Few Words About Terminology lt lt APWIN Application lt APWIN Basic Macro Editor my 5 et i o o lt le O 5 lt Program Macro 4 Code Module s lt Macro apb file Sub Main Statement q__ Main required End Sub Sub Procedure Siatement ig Sub optional T Function E MyFunctiont Ea i lt _ _ Function optional Figure 1 1 above The programming world uses the term Macro to describe what test engineers call a Procedure In reference to APWIN BASIC and for purposes of thi
22. s 1 6 Getting Started In APWIN BaSiC cs pus iaa eo ia i 1 7 APWIN Basic Editor Overview o 1 8 Editing Code with the APWIN Basic Editor 1 10 Where to Find More Information About Visual Basic 1 12 Information for Experienced Visual Basic Programmers 1 12 Fundamentals of APWIN Basic o oo 2 What is an APWIN Basic Program 2 1 Using Procedures 2 000002 ee eee eee 2 2 Elements of aProcedure 0 0 00000088 2 3 Introduction to Objects Methods and Properties 2 10 Writing An APWIN Basic Program o o 3 Converting S1 EXE Procedures to APWIN Basic 3 1 Using Learn Mode iii A 3 6 APWIN BASIC User s Guide and Language Reference Version 2 Page 1 CONTENTS Example APWIN Basic Program LL 3 8 Controlling Program FIO0W o o o o 3 20 Control Structures e 3 21 Loop Structures aaa a 3 24 Testing and Debugging APWIN Basic Code 4 Different Types of Programming Errors 00 4 1 Error Handling a a L 4 9 Creating Custom User Interfaces 228 5 REPOFts o nales a ri done e Gs ew ee 6 Language Reference o o eee eee 7 INGROGUICTION lt Frais a e N e a e de 7 1 CLOUDS gt ia da ee eed e eee a Aare e Dar a a 7 1
23. s manual the term Procedure refers to Sub and Function Procedure parts of a macro or code module as shown in figure 1 1 APWIN BASIC User s Guide and Language Reference Version 2 Page 1 5 Chapter 1 Where to Find Sample Files and Examples Where to Find Sample Files and Examples Included with your APWIN software are sample programs for System One System Two and System Two Cascade hardware If you choose to include the samples as part of your APWIN installation they can be found under the APWIN subdirectory Examples for each S 2 19 ko ES 43 System are found under their C Multtone own subdirectory The directory i el SysCheck EE Tutorial structure for the sample files is L A APBasic shown in figure 1 2 ii 9 ApwinTut i E a 2 These examples are excellent learning tools and are representative of the type of programs your are likely to develop You can load these macros into the APWIN Basic editor where you can edit them or even use them in whole or in part within your own program Samples contained in the DEMO directories are designed to be run without System hardware attached fa DlOanlyzr E a Procedures i CodecMultitone Anlyzr C Demonstration of FastT estMultitone amp nlyzr IntervuDiginterface amp nlyzr J MLSacousticTest io L SysChekSelfTest i Ga Tutorial a a Waveform Y Cascade Figure 1 2 Default APWIN directory Page 1 6 A
24. th other applications using OLE to produce custom reports E Chapter 7 is a listing of generic APWIN Basic commands available to you regardless of which hardware is being used and are used by all applications which utilize Visual Basic compatible commands Manual Conventions This manual uses the following typographic conventions Example Description event var arg For the syntax part of each command italicized words indicate placeholders where the user must enter additional information FILENAME TXT Words in all CAPITOL letters indicate file names APWIN BASIC User s Guide and Language Reference Version 2 Page 1 3 Chapter 1 A Few Words About Terminology Sub Main This font is used in all example macros and code AP Gen Amp 1 0 dul End Sub mogues Q ae S expressionlist In syntax items inside square brackets are optional o 2 While Until ES In syntax braces and a vertical bar indicate a choice rt between two or more items Command For the syntax part of each command the bold characters identify the part of the command that must be entered AP Prompt _ The line continue character _ is used to indicate that TEZE AS the code from one line to the next should be typed on 1s just an _ sae ine example A Few Words About Terminology Audio Precision has used the term Procedure since the first product to identify a facility that will automatically run a sequence of tests This te
25. tring without the leading or trailing spaces Return the string with S s leading and trailing spaces removed LTrim RTrim Sub Main Debug Print Trim x End Sub APWIN BASIC User s Guide and Language Reference Version 2 Page 7 153 Chapter 7 Language Commands Type roy Example Output x 19 i 10 Pal 0 eee 7 A Type Definition 10 n Syntax Private Public Type name elem Dim As typel 2 End Type G Description Define a new usertype Each elem defines an element of the type for storing data As type defines the type of data that can be stored A User defined type variable has a value for each elem Use elem to access individual element values Public is assumed if neither Private or Public is specified Example Type Employee Name As String Title As String Salary As Double End Type Sub Main Dim e As Employee e Name John Doe Title President e Salary 100000 Debug Print e Name John Doe Debug Print e Title President Debug Print e Salary 100000 End Sub Example Output John Doe President 100000 Page 7 154 APWIN BASIC User s Guide and Language Reference Version 2 Ni DI e D Q A h O 5 lo O TypeName Chapter 7 Language Commands TypeName Function Syntax TypeName var Parameters Name Description var Return a string indicating the type of value stored in this variable
26. unctions to APWIN to suit your measurement needs With APWIN Macros are lists of commands that tell APWIN Basic what to do Included with APWIN Basic are many extension commands you can use in your programs to automate control of Audio Precision s System hardware You do not need to develop any special commands to control APWIN and its attached hardware all of these commands are available when you begin using APWIN Basic my 5 et O 2 lt le O 5 One of the most exciting features in APWIN Basic is its support of OLE automation OLE stands for Object Linking and Embedding and is a standard used in Microsoft Windows to allow OLE compliant applications to share information Using the OLE automation features in APWIN Basic it is possible for example to take the results from a System measurement move the data into any Excel spreadsheet where it can be further manipulated then take these results into Microsoft Word where they can be inserted into a standard report form All of this can be automated and run entirely within APWIN Basic The results of your Word document can even be printed from inside APWIN Basic All of this power and functionality might lead you to think APWIN Basic is a difficult and complex programming language In fact APWIN Basic is one of the easiest development environments to use Even if you have never programmed before you will be surprised how quickly you will begin developing interesting and pow

Download Pdf Manuals

image

Related Search

Related Contents

User manual UM EN PROFINET SYS - Configurators  BENDIX BW1650 User's Manual  Atlantic Mitsu  descripción de las funciones características pantalla radio  Kustom KAA65 User's Manual  Guía avanzada del usuario    Sony SLV-AV100C User's Manual  IG9071MX IG9071MT handleiding notice d'utilisation anleitung  BFC-E Manuel d`utilisation - CNRS  

Copyright © All rights reserved.
Failed to retrieve file