Главная » Просмотр файлов » John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG

John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG (779881), страница 37

Файл №779881 John.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG (Symbian Books) 37 страницаJohn.Wiley.and.Sons.Rapid.Mobile.Enterprise.Development.for.Symbian.OS.An.Introduction.to.OPL.Application.Design.and.Programming.May.2005.eBook-LinG2018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 37)

There may be either one ELSE statementor none.After the ENDIF statement, the lines following ENDIFcarry on as normal.IF, ELSEIFs, ELSE, and ENDIF must be in that order.Every IF must be matched with a closing ENDIF.You can also have an IF...ENDIF structure withinanother, for example:IF condition1...ELSE...IF condition2....ENDIF...ENDIFcondition is an expression returning a logical value,for example a<b. If the expression returns logical true(non-zero) then the statements following are executed.If the expression returns logical false (zero) then thosestatements are ignored.INCLUDEIncludes a header fileUsage: INCLUDE file$Includes a file, file$, which may contain CONST definitions, prototypes for OPX procedures, and prototypesfor module procedures. The included file may notinclude module procedures themselves. Procedure andOPL COMMAND LIST215OPX procedure prototypes allow the translator to checkparameters and coerce numeric parameters (that are notpassed by reference) to the required type.Including a file is logically identical to replacing theINCLUDE statement with the file’s contents.The filename of the header may or may not include apath.

If it does include a path, then OPL will only scanthe specified folder for the file. However, the defaultpath for INLCUDE is \System\Opl\, so when INCLUDEis called without specifying a path, OPL looks for the filefirstly in the current folder and then in \System\Opl\in all drives from Y: to A: and then in Z:, excluding anyremote drives.See CONST, EXTERNAL.INPUTReads a value from the keyboardUsage: INPUT variableorINPUT log.fieldWaits for a value to be entered at the keyboard, andthen assigns the value entered to a variable or data filefield.You can edit the value as you type it in. All the usualediting keys are available: the arrow keys move alongthe line, Esc clears the line, and so on.If inappropriate input is entered, for example astring when the input was to be assigned to an integer variable, a ? is displayed and you can try again.However, if you used TRAP INPUT, control passes onto the next line of the procedure, with the appropriateerror condition being set and the value of the variableremaining unchanged.INPUT is usually used in conjunction with a PRINTstatement:PROC exch:LOCAL pds,rateDOPRINT "Pounds Sterling?",INPUT pdsPRINT "Rate (DM)?",INPUT rate216OPL COMMAND LISTPRINT "=",pds*rate,"DM"GETUNTIL 0ENDPNote the commas at the end of the PRINT statements,used so that the cursor waiting for input appears on thesame line as the messages.TRAP INPUTIf a bad value is entered (for example "abc" for a%) inresponse to a TRAP INPUT, the ? is not displayed, butthe ERR function can be called to return the value ofthe error that has occurred.

If the Esc key is pressedwhile no text is on the input line, the ‘Escape keypressed’ error (number −114) will be returned by ERR(provided that the INPUT has been trapped). You canuse this feature to enable someone to press the Esc keyto escape from inputting a value.See also EDIT. This works like INPUT, except that itdisplays a string to be edited and then assigned to avariable or field. It can only be used with strings.INSERTInserts a blank record into a databaseUsage: INSERTInserts a new, blank record into the current view ofa database. The fields can then be assigned to beforeusing PUT or CANCEL.INTGets the integer part of a floating point value (asan integer)Usage: i&=INT(x)Returns the integer (in other words the whole number)part of the floating point expression x. The number isreturned as a long integer.Positive numbers are rounded down, and negativenumbers are rounded up. For example, INT(-5.9) returns-5 and INT(2.9) returns 2.

If you want to round a numberto the nearest integer, add 0.5 to it (or subtract 0.5 if itis negative) before you use INT.See also INTF.OPL COMMAND LISTINTF217Gets the integer part of a floating point value (as afloating point number)Usage: i=INTF(x)Used in the same way as the INT function, but thevalue returned is a floating point number. For example,INTF(1234567890123.4) returns 1234567890123.0.You may also need this when an integer calculationmay exceed integer range.See also INT.INTRANSTrue if the current view is in a transactionUsage: i&=INTRANSFinds out whether the current view is in a transaction.Returns −1 if it is in a transaction or 0 if it is not.See also BEGINTRANS.IOAAsynchronous I/O requestUsage: r%=IOA(h%,f%,var status%,var a1,var a2)This has the same form as IOC, but it returns an errorvalue if the request is not completed successfully.

IOCshould be used in preference to IOA.IOCI/O request with guaranteed completionUsage: IOC(h%,f%,var status%,var a1,var a2)Make an I/O request with guaranteed completion. Thedevice driver opened with handle h% performs theasynchronous I/O function f% with two further arguments, a1 and a2. The argument status% is set bythe device driver. If an error occurs while making arequest, status% is set to an appropriate value, but IOCalways returns zero, not an error value. An IOWAIT orIOWAITSTAT must be performed for each IOC. IOCshould be used in preference to IOA.IOCANCELCancels an outstanding IO requestUsage: r%=IOCANCEL(h%)Cancels any outstanding asynchronous I/O request(IOC or IOA). Note, however, that the request willstill complete, so the signal must be consumed usingIOWAITSTAT.218IOCLOSEOPL COMMAND LISTCloses a fileUsage: r%=IOCLOSE(h%)Closes a file with the handle h%.See also I/O functions and commands.IOOPENCreates or opens a fileUsage: r%=IOOPEN(var h%,name$,mode%)Creates or opens a file called name$.

Defines h% foruse by other I/O functions. mode% specifies how toopen the file. For unique file creation, use IOOPEN(varh%,addr%,mode%).See also I/O functions and commands.IOREADReads from a fileUsage: r%=IOREAD(h%,addr&,maxLen%)Reads from the file with the handle h%. address% is theaddress of a buffer large enough to hold a maximum ofmaxLen% bytes. The value returned to r% is the actualnumber of bytes read or, if negative, is an error value.IOSEEKSeeks to a position in a file opened for random accessUsage: r%=IOSEEK(h%,mode%,var off&)Seeks to a position in a file that has been openedfor random access. mode% specifies how the offsetargument off& is to be used.

Values for mode% maybe found in the I/O functions and commands. off&may be positive to move forwards or negative to movebackwards. IOSEEK sets the variable off& to the absoluteposition set.Note the following example when you use #:ret%=IOSEEK(h%,mode%,#ptrOff&)passing the long integer ptrOff&.IOSIGNALSignals completion of asynchronous I/O functionUsage: IOSIGNALSignals an asynchronous I/O function’s completion.OPL COMMAND LISTIOW219Synchronous I/O requestUsage: r%=IOW(h%,func%,var a1,var a2)The device driver opened with handle h% performsthe synchronous I/O function func% with the two further arguments.IOWAITWaits for an asynchronous I/O function to completeUsage: IOWAITWaits for an asynchronous I/O function to signalcompletion.IOWAITSTATWaits for an IOC or IOA to completeUsage: IOWAITSTAT var stat%Waits for an asynchronous function, called with IOCor IOA, to complete.IOWAITSTAT32 Waits for asynchronous OPX procedure 32-bit statusword to completeUsage: IOWAITSTAT32 var stat&Takes a 32-bit status word.

IOWAITSTAT32 should becalled only when you need to wait for completion of arequest made using a 32-bit status word when callingan asynchronous OPX procedure.Note: The initial value of a 32-bit status word while itis still pending (i.e. waiting to complete) is &80000001(KStatusPending32& in Const.oph. For a 16-bit statusword the ‘pending value’ is −46 (KErrFilePending%).IOWRITEWrites bytes in a buffer to a fileUsage: r%=IOWRITE(h%,addr&,length%)Writes length% bytes in a buffer at address% to the filewith the handle h%.IOYIELDEnsures asynchronous functions have a chance to runUsage: IOYIELDEnsures that any asynchronous handler set up with IOCor IOA is given a chance to run. IOYIELD must alwaysbe called before polling status words, i.e. before reading220OPL COMMAND LISTa 16-bit status word if IOWAIT or IOWAITSTAT havenot been used first.KEYGets the last key pressed as a character codeUsage: k%=KEYReturns the character code of the key last pressed, ifthere has been a key press since the last use of thekeyboard by INPUT, EDIT, GET, GET$, KEY, KEY$,MENU, and DIALOG.If no key has been pressed, zero is returned.See Character codes for a list of special key codes.

Youcan use KMOD to check whether modifier keys (Shift,Ctrl, Fn, and Caps Lock) were used.This command does not wait for a key to be pressed,unlike GET.KEY$Gets the last key pressed as a stringUsage: k$=KEY$Returns the last key pressed as a string, if there has beena key press since the last use of the keyboard by INPUT,EDIT, GET, GET$, KEY, KEY$, MENU, and DIALOG.If no key has been pressed, a null string ("") isreturned.See Character codes for a list of special key codes. Youcan use KMOD to check whether modifier keys (Shift,Ctrl, Fn, and Caps Lock) were used.This command does not wait for a key to be pressed,unlike GET$.KEYAReads the keyboard asynchronouslyUsage: err%=KEYA(var stat%,var key%(1))This is an asynchronous keyboard read function.Cancel with KEYC.KEYCCancels a KEYAUsage: err%=KEYC(var stat%)Cancels the previously called KEYA function with status stat%.

Характеристики

Тип файла
PDF-файл
Размер
3,18 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6418
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее