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

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

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

s$ may include anymathematical function or operator. Note that floatingpoint arithmetic is always performed.EVAL runs in the "context" of the current procedure,so globals and externals can be used in s$, proceduresin loaded modules can be called, and the currentvalues of gX and gY can be used, etc. LOCAL variablescannot be used in s$ (because the translator cannotdeference them).For example:DOAT 10,5 :PRINT "Calc:",TRAP INPUT n$IF n$="" :CONTINUE :ENDIFIF ERR=-114 :BREAK :ENDIFCLS :AT 10,4PRINT n$;"=";EVAL(n$)UNTIL 0See also VAL.EXISTChecks if a file existsUsage: e%=EXIST(filename$)Checks to see that a file exists.

Returns KTrue% if thefile exists and KFalse% if it doesn’t.Use this function when creating a file to check thata file of the same name does not already exist, or whenopening a file to check that it has already been created:IF NOT EXIST("CLIENTS")CREATE "CLIENTS",A,names$ELSEOPL COMMAND LIST173OPEN "CLIENTS",A,names$ENDIF...EXPExponentialUsage: e=EXP(x)Returns ex – that is, the value of the arithmetic constante (2.71828...) raised to the power of x.EXTERNALDeclares procedure prototypes and external variablesUsage: EXTERNAL variableorEXTERNAL prototypeRequired if DECLARE EXTERNAL is specified in themodule.The first usage declares a variable as external. Forexample, EXTERNAL screenHeight%.The second usage declares the prototype of a procedure (prototype includes the final : and the argumentlist).

The procedure may then be referred to beforeit is defined. This allows parameter type-checking tobe performed at translate time rather than at runtime,and also provides the necessary information for thetranslator to coerce numeric argument types. This isreasonable because OPL does not support argumentoverloading. The same coercion occurs as when callingthe built-in keywords.Following the example of C and C++, you wouldnormally provide a header file declaring prototypes ofall the procedures and INCLUDE this header file at thebeginning of the module that defines the declared procedures to ensure consistency. The header file wouldalso be INCLUDEd in any other modules that call theseprocedures. Then you should use DECLARE EXTERNALat the beginning of modules that include the header fileso that the translator can ensure these procedures arecalled with correct parameter types, or types that canbe coerced.The following is an example of usage of DECLAREEXTERNAL and EXTERNAL:DECLARE EXTERNALEXTERNAL myProc%:(i%,l&)174OPL COMMAND LISTREM or INCLUDE "myproc.oph" that defines all yourproceduresPROC test:LOCAL i%,j%,s$(10)REM j% is coerced to a long integerREM as specified by the prototype.myProc%:(i%,j%)REM translator ‘Type mismatch’ error:REM string can’t be coerced to numeric typemyProc%:(i%,s$)REM wrong argument count gives translator errormyProc%:(i%)ENDPPROC myProc%:(i%,l&)REM Translator checks consistency with prototypeabove...ENDPSee DECLARE EXTERNAL.FIRSTPositions to the first recordUsage: FIRSTPositions to the first record in the current view.FIX$Converts a number to a stringUsage: f$=FIX$(x,y%,z%)Returns a string representation of the number x, to y%decimal places.

The string will be up to z% characters long.Example: FIX$(123.456,2,7) returns "123.46".If z% is negative then the string is right-justified,for example FIX$(1,2,-6) returns "1.00" where there aretwo spaces to the left of the 1.If z% is positive then no spaces are added, forexample FIX$(1,2,6) returns "1.00".If the number x will not fit in the width specified byz%, then the string will just be asterisks, for exampleFIX$(256.99,2,4) returns "****".OPL COMMAND LIST175See also GEN$, NUM$, SCI$.FLAGSSets an application’s system flagsUsage: FLAGS flags%Used within an APP...ENDA construct to provide theOPL application’s system flags.

Possible values forflags% are:KFlagsAppFileBased%1KFlagsAppIsHidden%2this application can create files. It willbe included in the list of applicationsoffered when the user creates a newfile from the System screenthis application does not appear on theExtras bar. It is very unusual to havethis flag setThese constants can be added together to combine theireffects. They are supplied in Const.oph.FLAGS may only be used within the APP...ENDAconstruct.See also APP and OPL applications.FLTConverts an integer to a floating point numberUsage: f=FLT(x&)Converts an integer expression (either integer or longinteger) into a floating point number.

Example:PROC gamma:(v)LOCAL cc=3E8RETURN 1/SQR(1-(v*v)/(c*c))ENDPYou could call this procedure like this: gamma:(FLT(a%)) if you wanted to pass it the value of an integervariable without having first to assign the integer valueto a floating point variable.See also INT and INTF.FONTSets the text window’s font and styleUsage: FONT id&,style%176OPL COMMAND LISTSets the text window’s font and style. Font constantsare provided in Const.oph, as they can be machinedependent.Standard font styles are:KgStyleNormal%KgStyleBold%KgStyleUnder%KgStyleInverse%KgStyleDoubleHeight%KgStyleMonoFont%KgStyleItalic%012481632normal styleboldunderlineinverse videodouble heightmono-spaced (typewriter) fontitalicAll these constants are provided in Const.oph.FREEALLOCFrees a previously allocated cellUsage: FREEALLOC pcell&Frees a previously allocated cell at pcell&.See also SETFLAGS if you require the 64K limit to beenforced.

If the flag is set to restrict the limit, pcell& isguaranteed to fit into a short integer.gATSets the drawing position using absolute coordinatesUsage: gAT x%,y%Sets the current position using absolute coordinates.gAT 0,0 moves to the top left of the current drawable.See also gMOVE.gBORDERDraws a borderUsage: gBORDER flags%,width%,height%orgBORDER flags%gBORDER is included for compatibility with olderversions of OPL, however, it is recommended that programmers use gCREATE and gXBORDER in preferenceto this function (see below).Draws a one-pixel wide, black border around theedge of the current drawable. If width% and height%are supplied, a border shape of this size is drawn withthe top left corner at the current position.

If they are notsupplied, the border is drawn around the whole of thecurrent drawable.OPL COMMAND LIST177flags% controls three attributes of the border: ashadow to the right and beneath, a one-pixel gap allaround, and the type of corners used. Its value can bebuilt from:KBordSglShadow%KBordSglGap%KBordDblShadow%KBordDblGap%KBordGapAllRound%KBordRoundCorners%KBordLosePixel%1234$100$200$400single pixel shadowremoves a single pixel shadowdouble pixel shadowremoves a double pixel shadowone pixel gap all roundmore rounded cornersless rounded corners (only onepixel missing at the corner)These constants are supplied in Const.oph.These shadows do not appear in the same waythat shadows on other objects, such as dialogs andmenu panes, appear. To display such shadows on awindow, you must specify them when using gCREATE.Hence you should use gCREATE (and gXBORDER) inpreference to gBORDER.You can combine the values to control the threedifferent effects.

(1, 2, 3, and 4 are mutually exclusive;you cannot use more than one of them.) For example,for rounded corners and a double pixel shadow, useflags%=$203.Set flags%=0 for no shadow, no gap, and sharpercorners.For example, to de-emphasize a previously emphasized border, use gBORDER with the shadow turnedoff:gBORDER 3GETgBORDER 4...REM show borderREM border offSee also gXBORDER.gBOXDraws a boxUsage: gBOX width%,height%Draws a box from the current position, width% tothe right and height% down.

The current positionis unaffected.178OPL COMMAND LISTany ofgBUTTON text$,type%,w%,h%,state%gBUTTON text$,type%,w%,h%,state%,bmpId&gBUTTON text$,type%,w%,h%,state%,bmpId&,maskId&gBUTTON text$,type%,w%,h%,state%,bmpId&,maskId&,layout%Draws a 3D black and grey button at the currentposition in a rectangle of the supplied width w% andheight h%, which fully encloses the button in all itsstates. text$ specifies up to 64 characters to be drawnin the button in the current font and style. You mustensure that the text will fit in the button.The type% argument specifies the type of buttonto be drawn.

For Symbian OS, this type% should beKButtS5%, although different values are supported bygBUTTON for backwards compatibility. Not all buttonstates are supported by older button types.KButtS5%2the standard Symbian OS buttontype. This is the style of buttonused on the 9210 and otherdevicesThe state% argument gives the button state:KButtS5Raised%KbuttS5SemiPressed%KbuttS5Sunken%012a raised buttona semi-depressed (flat) buttona fully-depressed (sunken) buttonThese constants are provided in Const.oph.gCIRCLEDraws a circleUsage: gCIRCLE radius%orgCIRCLE radius%,fill%Draws a circle with the center at the current position inthe current drawable. If the value of radius% is negativethen no circle is drawn.If fill% is supplied and if fill%<>0 then the circle isfilled with the current pen color.See gELLIPSE, gCOLOR.gCLOCKDraws or removes a clockOPL COMMAND LIST179Usage: any ofgCLOCK ON/OFFgCLOCK ON,mode%gCLOCK ON,mode%,offset&gCLOCK ON,mode%,offset&,format$gCLOCK ON,mode%,offset&,format$,font&gCLOCK ON,mode%,offset&,format$,font&,style%Displays or removes a clock showing the system time.The current position in the current window is used.Only one clock may be displayed in each window.mode% controls the type of clock:KgClockS5System%6KgClockS5Analog%KgClockS5Digital%KgClockS5LargeAnalog%789KgClockS5Formatted%11black and grey medium, systemsettingblack and grey medium, analogsecond type medium, digitalblack and grey, extra large,analogformatted digitalThe digital clock (mode%=KgClockS5Digital%) automatically displays the day of the week and day of themonth below the time.

The extra large analog clock(mode%=KgClockS5LargeAnalog%) automatically displays a second hand.Warning: Do not use gSCROLL to scroll the regioncontaining a clock. When the time is updated, theold position would be used. The whole window may,however, be moved using gSETWIN.Digital clocks display in 24-hour or 12-hour modeaccording to the system-wide setting.offset& specifies an offset in minutes from the systemtime to the time displayed. This allows you to displaya clock showing a time other than the system time. Aflag that has the value $100 may be ORed with mode%so that offset& may be specified in seconds rather thanminutes.

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

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

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

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