Главная » Просмотр файлов » 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), страница 30

Файл №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) 30 страница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СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

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

Use the function like this:DIR$(filespec$) returns the name of the first file matching the file specificationDIR$("") then returns the name of the second file inthe directoryDIR$("") again returns the third, and so onWhen there are no more matching files in the directory,DIR$("") returns a null string.Example (listing all the files whose names begin withA in C:\ME\):PROC dir:LOCAL d$(255)d$=DIR$("C:\ME\A*")WHILE d$<>""PRINT d$d$=DIR$("")ENDWHGETENDPdLONGDefines an edit box for a long integerUsage: dLONG var lg&,p$,min&,max&Defines an edit box for a long integer, to go in a dialog.p$ will be displayed on the left side of the line.min& and max& give the minimum and maximumvalues that are to be allowed. An error is raised if min&is higher than max&.lg& must be a LOCAL or a GLOBAL variable.

Itspecifies the value to be shown initially. When youOPL COMMAND LIST165finish using the dialog, the value you entered is returnedin lg&.See also dINIT.DO...UNTILConditional loopUsage:DOstatements......UNTIL conditionDO forces the set of statements that follow it to execute repeatedly until the condition specified by UNTILis met.This is the easiest way to repeat an operation acertain number of times.Every DO must have its matching UNTIL to endthe loop.If you set a condition that is never met, the programwill go round and round, locked in the loop forever.You can escape by pressing Ctrl+Esc, provided youhaven’t set ESCAPE OFF.

If you have set ESCAPE OFF,you will have to return to the Task list, select yourprogram in the list, and tap ‘Close file’.See also WHILE...ENDWH.DOWGets the day of the week from a dateUsage: d%=DOW(day%,month%,year%)Returns the day of the week from 1 (Monday) to 7(Sunday) given the date.day% must be between 1 and 31, month% from 1to 12, and year% from 1900 to 2155.For example, D%=DOW(4,7,1992) returns KSaturday.

Values for DOW are supplied in Const.oph:KMonday%KTuesday%KWednesday%KThursday%KFriday%KSaturday%KSunday%1234567166dPOSITIONOPL COMMAND LISTPositions a dialogUsage: dPOSITION x%,y%Positions a dialog. Use dPOSITION at any time betweendINIT and DIALOG.dPOSITION uses two integer values. The first specifies the horizontal position, and the second the vertical.

dPOSITION −1,−1 positions to the top leftof the screen; dPOSITION 1,1 to the bottom right;dPOSITION 0,0 to the center, the usual position fordialogs.dPOSITION 1,0, for example, positions to the righthand edge of the screen, and centers the dialog half-wayup the screen.Constants for these values are supplied in Const.oph.See also dINIT.dTEXTDefines text to be displayed in a dialogUsage: dTEXT p$,body$,t%ordTEXT p$,body$Defines a line of text to be displayed in a dialog.p$ will be displayed on the left side of the line, andbody$ on the right side. If you only want to displaya single string, use a null string ("") for p$, and passthe desired string in body$. It will then have the wholewidth of the dialog to itself. An error is raised if body$is a null string and the text line is not a separator(see below).body$ is normally displayed left-aligned (althoughusually in the right column).

You can override this byspecifying t%:KDTextLeft%KDTextRight%KDTextCentre%012left-align body$right-align body$center body$Alignment of body$ is only supported when p$ is null,with the body being left-aligned otherwise. In addition,you can add any or all of the following three values tot%, for these effects:KDTextLineBelow%KDTextAllowSelection%$200$400draw a line below this itemallow this item’s prompt (not itsbody text) to be selectedOPL COMMAND LISTKDTextSeparator%$800167specify this item as a textseparator. p$ and body$ mustboth be the null string for this totake effectThe separator counts as an item in the value returnedby DIALOG.These constants are supplied in Const.oph.See also dEDIT, dINIT.dTIMEDefines an edit box for a timeUsage: dTIME var lg&,p$,t%,min&,max&Defines an edit box for a time, to go in a dialog.p$ will be displayed on the left side of the line.lg&, which must be a LOCAL or a GLOBAL variable, specifies the time to be shown initially.

Althoughit will appear on the screen like a normal time, forexample 18:27, lg& must be specified as seconds after00:00. A value of 60 means one minute past midnight;3600 means one o’clock, and so on.min& and max& give the minimum and maximumvalues that are to be allowed. Again, these are inseconds after 00:00. An error is raised if min& is higherthan max&.When you finish using the dialog, the time youentered is returned in lg&, in seconds after 00:00.The display in the time editor can be controlled viathe t% argument. Add together one or more of thefollowing constants from Const.oph to form t%:KDTimeWithSeconds%KDTimeDuration%KDTimeNoHours%KDTime24Hour%1248time editor shows secondsediting a durationtime editor does not show hourstime editor uses the 24-hour clockThis can be bulky to specify, however, so the followingconvenience constants are also defined:KDTimeAbsNoSecs%KDTimeAbsWithSecs%KDTimeDurationNoSecs%KDTimeDurationWithSecs%0123absolute + no secondsabsolute + secondsduration + no secondsduration + secondsFor example, 03:45 represents an absolute time, while3 hours 45 minutes represents a duration.168OPL COMMAND LISTAbsolute times are displayed in 24-hour or a.m./p.m.format according to the current system setting.

8 displays the time in 24-hour clock, regardless of thesystem setting.Absolute times always display a.m. or p.m. as appropriate, unless the 24-hour clock is being used. Durations never display a.m. or p.m. Note, however, that ifyou use the flag 4 (no hours) then the a.m./p.m. symbolwill be displayed and the flag 2 must be added if youwish to hide it.See also dINIT.dXINPUTDefines an exit box for a secret stringUsage: dXINPUT var str$,p$,seed%Defines a secret string edit box, such as for a password,to go in a dialog.p$ will be displayed on the left side of the line.str$ is the string variable to take the string you type.KDXInputMaxLen%16maximum lengthof str$This constant is supplied in Const.oph.Initially the dialog does not show any charactersfor the string unless seed% is set to true (KTrue%in Const.oph); if seed% is omitted or set to anothervalue, the initial contents of str$ are ignored. A specialsymbol will be displayed for each character you type,to preserve the secrecy of the string.See also dINIT.EDITDisplays a string for editingUsage: EDIT a$Displays a string variable that you can edit directly onthe screen.

All the usual editing keys are available: thearrow keys move along the line, Esc clears the line, andso on.When you have finished editing, press Enter to confirm the changes. If you press Enter before you havemade any changes, then the string will be unaltered.If you use EDIT in conjunction with a PRINT statement, use a comma at the end of the PRINT statement,OPL COMMAND LIST169so that the string to be edited appears on the same lineas the displayed string:...PRINT "Edit address: ",EDIT A.address$UPDATE....TRAP EDITIf the Esc key is pressed while no text is on the input line,the ‘Escape key pressed’ error (−144) will be returnedby ERR provided that the EDIT has been trapped.

Youcan use this feature to enable the user to press the Esckey to escape from inputting a string.See also INPUT, dEDIT.ELSE/ELSEIF/ENDIFSee IFSee IF.ENDASee APPSee APP.ENDVSee VECTORSee VECTOR.ENDWHSee WHILESee WHILE.EOFChecks for end-of-fileUsage: e%=EOFFinds out whether you’re at the end of a file yet.Returns −1 (true) if the end of the file has beenreached, or 0 (false) if it hasn’t.When reading records from a file, you should testwhether there are still records left to read, otherwiseyou may get an error.Example:PROC eoftest:OPEN "myfile",A,a$,b%DO170OPL COMMAND LISTPRINT A.a$PRINT A.b%NEXTPAUSE -40UNTIL EOFPRINT "The last record"GETRETURNENDPERASEErases a record in the current data fileUsage: ERASEErases the current record in the current file.The next record is then current. If the erased recordwas the last record in a file, then following this command the current record will be null and EOF willreturn true.ERRNumber of last errorUsage: e%=ERRReturns the number of the last error which occurred, or0 if there has been no error.Example:...PRINT "Enter age in years"age::TRAP INPUT age%IF ERR=-1PRINT "Number please:"GOTO ageENDIF...You can set the value returned by ERR to 0 (or anyother value) by using TRAP RAISE 0.

This is useful forclearing ERR.See also ERR$, ERRX$. See Runtime errors – Handling errors reported while running programs for fulldetails, and OPL error values for the list of error numbersand messages.ERR$Looks up an error message by numberUsage: e$=ERR$(x%)OPL COMMAND LIST171Returns the error message for the specified errorcode x%.ERR$(ERR) gives the message for the last error thatoccurred. Example:TRAP OPEN "\FILE",A,field1$IF ERRPRINT ERR$(ERR)RETURNENDIFSee also ERR, ERRX$.

See Runtime errors – Handlingerrors reported while running programs for full details,and OPL error values for the list of error numbersand messages.ERRX$Gets an extended error messageUsage: x$=ERRX$Returns the current extended error message (when anerror has been trapped), e.g.’Error inMODULE\PROCEDURE,EXTERN1,EXTERN2,...’which would have been presented as an alert if the errorhad not been trapped. This allows the list of missingexternals, missing procedure names, etc.

to be foundwhen an error has been trapped by a handler.See Runtime errors – Handling errors reported whilerunning programs for full details, and OPL error valuesfor the list of error numbers and messages.ESCAPE OFFDisables Ctrl+EscUsage:ESCAPE OFF...ESCAPE ONESCAPE OFF stops Ctrl+Esc being used to break out ofthe program when it is running. ESCAPE ON enablesthis feature again.ESCAPE OFF takes effect only in the procedure inwhich it occurs, and in any subprocedures that are172OPL COMMAND LISTcalled. Ctrl+Esc is always enabled when a programbegins running.If your program enters a loop that has no logical exit,and ESCAPE OFF has been used, you will have to goto the Task list, move to the program name, and selectClose file.EVALEvaluates a mathematical expressionUsage: d=EVAL(s$)Evaluates the mathematical string expression s$ andreturns the floating point result.

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

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

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

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