ScriptForge.Basic zerbitzua

ScriptForge.Basic zerbitzuak Python testuinguruan exekutatu daitezkeen LibreOffice Basic metodoen bilduma bat proposatzen du. Basic zerbitzuko metodoek Basic funtzio integratuen sintaxi eta portaera bera dute.

Adibide tipikoa:


   bas.MsgBox('Bistaratu testu hau mezu-koadro modura Python script batetik')
  
warning

ScriptForge.Basic zerbitzua Python script-etarako soilik da.


Zerbitzuari deitzea

note

Basic zerbitzua erabili baino lehen, inportatu scriptforge moduluko CreateScriptService() metodoa:



    from scriptforge import CreateScriptService
    bas = CreateScriptService("Basic")
  

Propietateak

Izena

Irakurtzeko soilik

Mota

Deskribapena

MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL

Bai

Integer

Balioak: 0, 1, 5, 4, 3

MB_ICONEXCLAMATION, MB_ICONINFORMATION, MB_ICONQUESTION, MB_ICONSTOP

Bai

Integer

Balioak: 48, 64, 32, 16

MB_ABORTRETRYIGNORE, MB_DEFBUTTON1, MB_DEFBUTTON2, MB_DEFBUTTON3

Bai

Integer

Balioak: 2, 128, 256, 512

IDABORT, IDCANCEL, IDIGNORE, IDNO, IDOK, IDRETRY, IDYES

Bai

Integer

Balioak: 3, 2, 5, 7, 1, 4, 6
MsgBox koadroan hautatutako botoia adierazten duten konstanteak.

StarDesktop

Bai

UNO
objektua

Returns the StarDesktop object that represents the LibreOffice application.

ThisComponent

Yes

UNO
object

If the current component refers to a LibreOffice document, this method returns the UNO object representing the document. This property returns None when the current component does not correspond to a document.

ThisDatabaseDocument

Yes

UNO
object

If the script is being executed from a Base document or any of its subcomponents this method returns the main component of the Base instance. This property returns None otherwise.


Basic zerbitzuko metodoen zerrenda

CDate
CDateFromUnoDateTime
CDateToUnoDateTime
ConvertFromUrl (*)
ConvertToUrl (*)
CreateUnoService
CreateUnoStruct (*)
DateAdd

DateDiff
DatePart
DateValue
Format
GetDefaultContext
GetGuiType (*)
GetPathSeparator (*)
GetSystemTicks

GlobalScope.BasicLibraries
GlobalScope.DialogLibraries
InputBox (*)
MsgBox (*)
Now
RGB
Xray


note

Python alternatives exist for methods marked with (*).


CDate

Zenbakizko adierazpen bat edo kate bat datetime.datetime jatorrizko Python objektu bihurtzen du

note

Metodo honek Basic-en CDate funtzio integratua Phyton scriptei erakusten die.


Sintaxia:

svc.CDate(expression: any): obj

Parametroak:

expression: Data bat ordezkatzen duen zenbakizko adierazpen bat edo kate bat.

When you convert a string expression, the date and time must be entered either in one of the date acceptance patterns defined for your locale setting (see - Languages and Locales - General) or in ISO date format (momentarily, only the ISO format with hyphens, e.g. "2012-12-31" is accepted). In numeric expressions, values to the left of the decimal represent the date, beginning from December 31, 1899. Values to the right of the decimal represent the time.

Adibidea:


    d = bas.CDate(1000.25)
    bas.MsgBox(str(d)) # 1902-09-26 06:00:00
    bas.MsgBox(d.year) # 1902
  

CDateFromUnoDateTime

UNO data/ordua irudikapen bat Python lengoaiako datetime.datetime jatorrizko objektu bihurtzen du.

Sintaxia:

svc.CDateFromUnoDateTime(unodate: uno): obj

Parametroak:

unodate: UNO data/ordua objektu bat, honako motetako batekoa: com.sun.star.util.DateTime, com.sun.star.util.Date edo com.sun.star.util.Time

Adibidea:

Hurrengo adibideak com.sun.star.util.DateTime objektu bat sortzen du eta datetime.datetime Python objektu bihurtzen du.


    uno_date = bas.CreateUnoStruct('com.sun.star.util.DateTime')
    uno_date.Year = 1983
    uno_date.Month = 2
    uno_date.Day = 23
    new_date = bas.CDateFromUnoDateTime(uno_date)
    bas.MsgBox(str(new_date)) # 1983-02-23 00:00:00
  

CDateToUnoDateTime

Data baten irudikapen bat com.sun.star.util.DateTime objektu bihurtzen du.

Sintaxia:

svc.CDateToUnoDateTime(date: obj): uno

Parametroak:

date: Python data/ordu objektu bat, honako motetako batekoa: datetime.datetime, datetime.date, datetime.time, float (time.time) edo time.struct_time.

Adibidea:


    from datetime import datetime
    current_datetime = datetime.now()
    uno_date = bas.CDateToUnoDateTime(current_datetime)
    bas.MsgBox(str(uno_date.Year) + "-" + str(uno_date.Month) + "-" + str(uno_date.Day))
  

ConvertFromUrl

Emandako file: URLaren sistemako fitxategi-izena itzultzen du.

Sintaxia:

svc.ConvertFromUrl(url: str): str

Parametroak:

url: file: URL absolutu bat.

Return type:

Sistemako bide-izenen fitxategi-izen bat.

Adibidea:


    filename = bas.ConvertFromUrl( "file:///C:/Program%20Files%20(x86)/LibreOffice/News.txt" )
    bas.MsgBox(filename)
  
tip

uno module fileUrlToSystemPath() method returns a system path using an identical syntax.



    import uno
    filename = uno.fileUrlToSystemPath( "file:///C:/Program%20Files%20(x86)/LibreOffice/News.txt" )
    bas.MsgBox(filename)
  

ConvertToUrl

file: URL bat itzultzen du emandako sistemaren bide-izenerako.

Sintaxia:

svc.ConvertToUrl(systempath: str): str

Parametroak:

systempath: Sistemako fitxategi-izen bat kate gisa.

Return type:

file: URL bat kate gisa.

Adibidea:


    url = bas.ConvertToUrl( 'C:\Program Files(x86)\LibreOffice\News.txt' )
    bas.MsgBox(url)
  
tip

uno module systemPathToFileUrl() method returns a file URL for the given system path.



    from uno import systemPathToFileUrl as ConvertToUrl
    filename = ConvertToUrl( 'C:\Program Files(x86)\LibreOffice\News.txt' )
    bas.MsgBox(filename)
  

CreateUnoService

UNO zerbitzu baten instantzia bat sortzen du ProcessServiceManager prozesuen zerbitzu-kudeatzailearekin.

Sintaxia:

svc.CreateUnoService(servicename: str): uno

Parametroak:

servicename: Osorik kualifikatutako zerbitzu-izen bat, adibidez com.sun.star.ui.dialogs.FilePicker edo com.sun.star.sheet.FunctionAccess.

Adibidea:


    dsk = bas.CreateUnoService('com.sun.star.frame.Desktop')
  

CreateUnoStruct

Zehaztutako motako UNO egitura baten instantzia bat itzultzen du.

Sintaxia:

svc.CreateUnoStruct(unostructure: str): uno

Parametroak:

unostructure: Egitura baten izen kualifikatu osoa, adibidez com.sun.star.beans.Property edo com.sun.star.util.DateTime.

Adibidea:


    date_struct = CreateUnoStruct('com.sun.star.util.DateTime')
  
tip

uno module createUnoStruct() method creates an instance of a Uno structure type.



    import uno
    p = uno.createUnoStruct( 'com.sun.star.beans.Property' )
    bas.MsgBox(p)
  

DateAdd

Data- edo ordu-tarte bat gehitzen dio emandako data/ordu bati hainbat aldiz, eta eragiketa horren emaitza den data itzultzen du.

Sintaxia:

svc.DateAdd(interval: str, number: num, date: datetime): datetime

Parametroak:

interval - Ondorengo taularako kate-adierazpena, data- edo ordu-barrutia zehazten duena.

tartea (kate-balioa)

Azalpena

yyyy

Urtea

q

Hiruhilekoa

m

Hilabetea

y

Urteko eguna

w

Asteko eguna

ww

Urteko astea

d

Eguna

h

ordua

n

Minutua

s

Segundoa


number: Zenbakizko adierazpen bat, interval balioa zenbat aldiz gehituko den (positiboa denean) edo kenduko den (negatiboa denean) zehazten duena.

date: Emandako datetime.datetime balio bat, interval balioa number aldiz gehituko zaio datetime.datetime balioari.

Return type:

datetime.datetime balio bat.

Adibidea:


    dt = datetime.datetime(2004, 1, 31)
    dt = bas.DateAdd("m", 1, dt)
    print(dt)
  

DateDiff

Emandako bi data- edo ordu-balioen arteko data-/ordu-tarteen kopurua itzultzen du.

Sintaxia:

svc.DateDiff(interval: str, date1: datetime, date2: datetime, firstdayofweek = 1, firstweekofyear = 1): int

Parametroak:

interval: Data-tartea zehazten duen kate-adierazpen bat, goiko DateAdd metodoan adierazten den modukoa.

date1, date2: Konparatuko diren bi datetime.datetime balioak.

astekoLehenEguna: Astearen lehen eguna zehazten duen aukerako parametroa.

astekoleheneguna balioa

Azalpena

0

Sistemaren balio lehenetsia erabiltzen du

1

Igandea (lehenetsia)

2

Astelehena

3

Asteartea

4

Asteazkena

5

Osteguna

6

Ostirala

7

Larunbata


urtekolehenastea: Aukerako parametro bat, urte bateko hasierako astea zehazten duena.

urtekolehenastea balioa

Azalpena

0

Sistemaren balio lehenetsia erabiltzen du

1

1. astea urtarrilaren 1a duen astea da (lehenetsia)

2

1. astea urte horretako lau egun edo gehiago dituen lehenengo astea da

3

1. astea urte berriko egunak bakarrik dituen lehenengo astea da


Return type:

Zenbaki bat.

Adibidea:


    date1 = datetime.datetime(2005,1, 1)
    date2 = datetime.datetime(2005,12,31)
    diffDays = bas.DateDiff('d', date1, date2)
    print(diffDays)
  

DatePart

DatePart funtzioak data batean zehaztutako zati bat itzultzen du.

Sintaxia:

svc.DatePart(interval: str, date: datetime, firstdayofweek = 1, firstweekofyear = 1): int

Parametroak:

interval: Data-tartea zehazten duen kate-adierazpen bat, goiko DateAdd metodoan adierazten den modukoa.

date: Emaitza data/ordu horretatik kalkulatuko da.

firstdayofweek, firstweekofyear: goiko DateDiff metodoan zehaztu den moduan, astearen eta urtearen hasierako eguna zehazten dituzten aukerako parametroak.

Return type:

Erauzitako zatia emandako datarako/ordurako.

Adibidea:


    print(bas.DatePart("ww", datetime.datetime(2005,12,31)
    print(bas.DatePart('q', datetime.datetime(1999,12,30)
  

DateValue

Data-balio bat kalkulatzen du data-kate bat erabilita.

Sintaxia:

svc.DateValue(date: str): datetime

Parametroak:

data: Data objektu bihurtuko den data duen katea.

note

The string passed to DateValue must be expressed in one of the date formats defined by your locale setting (see - Languages and Locales - General) or using the ISO date format "yyyy-mm-dd" (year, month and day separated by hyphens).


Return type:

Kalkulatutako data.

Adibidea:


    dt = bas.DateValue("23-02-2011")
    print(dt)
  

Format

Zenbaki bat kate bihurtzen du, eta zehaztutako formatuaren arabera aldatzen du.

Sintaxia:

svc.Format(expression: any, format = ''): str

Parametroak:

adierazpena: Formatudun kate bihurtuko den zenbakizko adierazpena.

format: String that specifies the format code for the number. If format is omitted, the Format function works like the LibreOffice Basic Str() function.

Return type:

Testu-katea.

Kodeei formatua ematea

In BASIC, a format code can be divided into three sections that are separated by semicolons. The first part defines the format for positive values, the second part for negative values, and the third part for zero. If you only specify one format code, it applies to all numbers.

You can set the locale used for controlling the formatting numbers, dates and currencies in LibreOffice Basic in - Languages and Locales - General. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character.

Gauza bera dagokie data-, ordu- eta moneta-formatuen eskualde-ezarpenei ere. Basic formatu-kodea eskualde-ezarpenaren arabera interpretatu eta bistaratuko da.

Hurrengo zerrendan, zenbakizko adierazpen bati formatua emateko erabili daitezkeen kodeak deskribatzen dira:

Code

Description

0

If expression has a digit at the position of the 0 in the format code, the digit is displayed, otherwise a zero is displayed.

adierazpena adierazpenak formatua kodeko zero kopurua baino digitu gutxiago baditu (dezimalaren edozein aldetan), aurreko eta atzeko zeroak bistaratuko dira. adierazpenak formatua kodeak duen zero kopurua baino digitu gehiago baditu dezimalen bereizlearen ezkerrean, gainerako digituak formateatu gabe bistaratuko dira.

adierazpena adierazpeneko dezimalak borobildu egingo dira formatua kodeko dezimal-bereizlearen ondoren agertzen diren zero kopuruaren arabera.

#

If expression contains a digit at the position of the # placeholder in the format code, the digit is displayed, otherwise nothing is displayed at this position.

Ikur honek 0 zenbakiaren moduan funtzionatzen du, baina aurreko eta atzeko zeroak ez dira bistaratzen # karaktere gehiago badaude formatua kodean, adierazpena adierazpenean dauden digituak baino. adierazpena adierazpeneko digitu esanguratsuak soilik bistaratuko dira.

. (period)

The decimal placeholder determines the number of decimal places to the left and right of the decimal separator.

formatua kodeak # leku-markak soilik baditu ikur horren ezkerrean, 1 baino txikiagoko zenbakiek dezimalen bereizle bat izango dute hasieran. Zenbaki zatikiarretan aurreko zeroa beti bistaratzeko, erabili 0 leku-marka gisa dezimalen bereizlearen ezkerreko lehenengo digituan.

Puntua milakoen eta dezimalen bereizle gisa erabiltzea eskualdeko ezarpenen arabera dago. Zenbaki bat zuzenean Basic iturburu-kodean sartzean, puntua erabili beti dezimal-bereizle gisa. Unean dezimalen bereizle gisa bistaratutako karakterea zure sistemako ezarpenen zenbaki-formatuaren arabera dago.

%

Multiplies the expressionby 100 and inserts the percent sign (%) where the expression appears in the format code.

E- E+ e- e+

If the format code contains at least one digit placeholder (0 or #) to the right of the symbol E-, E+, e-, or e+, the expression is formatted in the scientific or exponential format. The letter E or e is inserted between the number and the exponent. The number of placeholders for digits to the right of the symbol determines the number of digits in the exponent.

Esponentea negatiboa bada, minus ikurra bistaratuko da berehala esponente baten aurrean honako ikurrekin: E-, E+, e-, e+. Esponentea positiboa bada, plus ikurra bakarrik bistaratuko da esponenteen aurrean E+ edo e+ ikurrarekin.

- + $ ( ) space

: A plus (+), minus (-), dollar ($), space, or brackets entered directly in the format code is displayed as a literal character.

\

Hemen zerrendatzen ez diren karaktereak bistaratzeko, aurrean alderantzizko barra (\) jarri behar diezu, edo komatxo artean (" ") jarri behar dituzu.

The backslash displays the next character in the format code.

Esanahi berezia duten eta formatua kodean ageri diren karaktereak modu literalean bistaratu nahi badira, aurretik alderantzizko barra eraman behar dute. Alderantzizko barra bera ez da bistaratuko, salbu eta formatu-kodean alderantzizko barra bi aldiz jarraian (\\) sartzen bada.

Karaktere gisa bistaratu ahal izateko formatu-kodean aurretik alderantzizko barra izan behar duten karaktereak hauek dira: data- eta denbora-formatuko karaktereak (a, c, d, h, m, n, p, q, s, t, w, y, /, :), zenbaki-formatuko karaktereak (#, 0, %, E, e, koma, puntua) eta kate-formatuko karaktereak (@, &, <, >, !).


Predefined formats

Aurredefinitutako ondorengo zenbaki-formatuak ere erabil daitezke. "General Number" izan ezik, aurredefinitutako formatu-kode guztiek zenbaki dezimal gisa, bi dezimalekin, itzultzen dituzte zenbakiak.

Aurrez definitutako formatuak erabiltzen badituzu, formatuaren izenak komatxo artean egon behar du.

Code

Description

"<"

Convert expression to lower case

">"

Convert expression to upper case.

"c" or "General Date"

Returns the numeric expression in short date format, optionally with "H:MM:SS AM/PM". If expression is a string, returns the string.

"n"

Returns the minute of the numeric expression, with 1 or 2 digits.

"nn"

Returns the minute of the numeric expression with two digits.

"w"

Returns the week day of the numeric expression. 1 is Sunday and 7 is Saturday.

"General Number"

Returns the numeric expression with 12 digits (0.############).

"Currency"

Returns the numeric expression in the currency of the locale.

"Fixed"

Returns the numeric expression with 2 decimal places (0.00).

"Standard"

Returns the numeric expression with thousands separators and 2 decimals (@0.00).

"Percent"

Returns the numeric expression as percent value (0.00%).

"Scientific"

Returns the numeric expression in scientific notation (#.00E+00);

"Yes/No"

Returns "Yes" if the numeric expression is not equal to zero, "No" otherwise. "Yes" and "No" are localized.

"True/False"

Returns "True" if the numeric expression is not equal to zero, "False" otherwise. "True" and "False" are localized.

"On/Off"

Returns "On" if the numeric expression is not equal to zero, "Off" otherwise. "On" and "Off" are localized.

"Long Date" or "dddddd"

Returns the numeric expression in system long date format, and depends on the locale.

"Medium Date"

Returns the numeric expression in date format DD-MMM-YY, and depends on the locale.

"Short Date" or "ddddd"

Returns the numeric expression in system short date format, and depends on the locale.

"Long Time" or "ttttt"

Returns the numeric expression in system long time format, and depends on the locale("H:MM:SS AM/PM").

"Medium Time"

Returns the numeric expression in system medium time format, and depends on the locale (HH:MM AM/PM)

"Short Time"

Returns the numeric expression in system short time format, and depends on the locale (HH:MM).


You can set the locale used for controlling the formatting numbers, dates and currencies in LibreOffice Basic in - Languages and Locales - General. In Basic format codes, the decimal point (.) is always used as placeholder for the decimal separator defined in your locale and will be replaced by the corresponding character.

Gauza bera dagokie data-, ordu- eta moneta-formatuen eskualde-ezarpenei ere. Basic formatu-kodea eskualde-ezarpenaren arabera interpretatu eta bistaratuko da.

Adibidea:


    txt = bas.Format(6328.2, '##.##0.00')
    print(txt)
  

GetDefaultContext

Prozesu-zerbitzuaren faktoriaren testuinguru lehenetsia itzultzen du, existitzen bada, eta bestela erreferentzia nulu bat itzultzen du.

GetDefaultContext metodoa getComponentContext() metodoaren ordezko bat da. Bigarren hori XSCRIPTCONTEXT aldagai globalean edo uno.py moduluan eskuratu daiteke.

Sintaxia:

svc.GetDefaultContext(): uno

Return type:

Osagai-testuinguru lehenetsia erabiltzen da zerbitzuen instantziak XMultiServiceFactory bidez sortzean. Informazio gehiagorako, ikusi garatzaile-gidako Professional UNO kapitulua api.libreoffice.org gidan.

Adibidea:


    ctx = bas.GetDefaultContext()
  

GetGuiType

Erabiltzaile-interfaze grafikoa zehazten duen zenbakizko balio bat itzultzen du. Funtzio hau aurreko bertsioekin bateragarritasuna mantentzeko soilik erabiltzen da.

Begiratu platform Python moduluaren system() metodoa sistema eragilea identifikatzeko.

Sintaxia:

svc.GetGuiType(): int

Adibidea:


    n = bas.GetGuiType()
  
note

Wiser script instructions are available from Identifying the operating system help page.


tip

• ScriptForge.Platform service provides a collection of properties about the current execution environment and context, that include platform detection.

• Extensive operating system name identification is available from INFO("system") Calc formula.


GetPathSeparator

Fitxategien bide-izenak zehazteko erabilitako direktorio-bereizlea, sistema eragilearen araberakoa dena, itzultzen du.

Erabili os Python moduluko os.pathsep bide-izenen bereizlea identifikatzeko.

Sintaxia:

svc.GetPathSeparator(): str

Adibidea:


    sep = bas.GetPathSeparator()
  

GetSystemTicks

Sistema eragileak emandako denbora-marken kopurua itzultzen du. Funtzio hau zenbait prozesu optimizatzeko erabili daiteke. Erabili metodo hau denbora milisegundotan kalkulatzeko:

Sintaxia:

svc.GetSystemTicks(): int

Adibidea:


    ticks_ini = bas.GetSystemTicks()
    time.sleep(1)
    ticks_end = bas.GetSystemTicks()
    bas.MsgBox("{} - {} = {}".format(ticks_end, ticks_ini,ticks_end - ticks_ini))
  

GlobalScope.BasicLibraries

Partekatutako Basic liburutegi eta modulu guztiak dituen UNO objektu bat itzultzen du.

Metodo hori Python lengoaien GlobalScope.BasicLibraries elementuaren parekoa da Basic scriptetan.

Sintaxia:

svc.GlobalScope.BasicLibraries(): uno

Return type:

com.sun.star.script.XLibraryContainer

Adibidea:

Hurrengo adibideak Gimmicks izeneko Basic liburutegia kargatzen du, oraindik kargatu gabe badago.


    libs = bas.GlobalScope.BasicLibraries()
    if not libs.isLibraryLoaded("Gimmicks"):
        libs.loadLibrary("Gimmicks")
  

GlobalScope.DialogLibraries

Elkarrizketa-koadroen liburutegi partekatu guztiak dituen UNO objektu bat itzultzen du.

Metodo hori Python lengoaien GlobalScope.DialogLibraries elementuaren parekoa da Basic scriptetan.

Sintaxia:

svc.GlobalScope.DialogLibraries(): uno

Return type:

com.sun.star.comp.sfx2.DialogLibraryContainer

Adibidea:

Hurrengo adibidean, erabilgarri dauden elkarrizketa-koadroen liburutegi guztien izenak dituen mezu-koadro bat erakusten da.


    dlg_libs = bas.GlobalScope.DialogLibraries()
    lib_names = dlg_libs.getElementNames()
    bas.MsgBox("\n".join(lib_names))
  

InputBox

Sintaxia:

svc.InputBox(prompt: str, [title: str], [default: str], [xpostwips: int, ypostwips: int]): str

Parametroak:

prompt: Elkarrizketa-koadroan mezu gisa bistaratzen den kate-adierazpena.

title: Elkarrizketa-koadroaren izenburu-barran bistaratutako kate-adierazpena.

default: Testu-koadroan lehenetsi gisa bistaratzen den kate-adierazpena, beste sarrerarik ematen ez bada.

xpostwips: Elkarrizketa-koadroaren kokagune horizontala zehazten duen osoko zenbakidun adierazpena. Kokagunea koordenatu absolutua da eta ez dagokio LibreOffice leihoari.

ypostwips: Elkarrizketa-koadroaren kokagune bertikala zehazten duen osoko zenbakidun adierazpena. Kokagunea koordenatu absolutua da eta ez dagokio LibreOffice leihoari.

xpostwips eta ypostwips erabiltzen ez badira, elkarrizketa-koadroa pantailaren erdian agertuko da. Kokagunea twip unitatetan zehazten da.

Return type:

String

Adibidea:


    txt = s.InputBox('Sartu esaldi bat:', "Erabiltzaile maitea")
    s.MsgBox(txt, s.MB_ICONINFORMATION, "Esaldia berrestea")
  
note

Informazio gehiagorako, begiratuPantailaren sarrerak/irteerak Python bidez wikian.


MsgBox

Mezu bat duen elkarrizketa-koadro bat bistaratzen du eta aukerako balio bat itzultzen du.
MB_xx konstanteak elkarrizketa-koadroaren mota zehazteko, bistaratuko diren botoien kopurua eta mota zehazteko eta ikono mota zehazteko erabili daitezke. Haien balioak gehituta, bit-ereduak osatzen dituzte eta MsgBox elkarrizketa-koadroaren itxura definitzen dute.

Sintaxia:

bas.MsgBox(prompt: str, [buttons: int], [title: str])[: int]

Parametroak:

prompt: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13).

title: String expression displayed in the title bar of the dialog. If omitted, the title bar displays the name of the respective application.

buttons: Any integer expression that specifies the dialog type, as well as the number and type of buttons to display, and the icon type. buttons represents a combination of bit patterns, that is, a combination of elements can be defined by adding their respective values:

Return type:

Aukerako osoko zenbaki bat, goiko IDxx propietateetan zehaztu den moduan.

Adibidea:


    txt = s.InputBox('Sartu esaldi bat:', "Erabiltzaile maitea")
    s.MsgBox(txt, s.MB_ICONINFORMATION, "Esaldia berrestea")
  
note

Informazio gehiagorako, begiratuPantailaren sarrerak/irteerak Python bidez wikian.


Now

Sistemaren uneko data eta ordua itzultzen ditu datetime.datetime jatorrizko Python objektu gisa.

Sintaxia:

svc.Now(): datetime

Adibidea:


    bas.MsgBox(bas.Now(), bas.MB_OK, "Now")
  

RGB

Zenbaki osoz osatutako kolore-balio bat itzultzen du. Balioak osagai gorri, berde eta urdina ditu.

Sintaxia:

svc.RGB(red:int, green: int, blue: int): int

Parametroak:

red: Kolore konposatuaren osagai gorria (0-255) adierazten duen osoko adierazpena.

green: Kolore konposatuaren osagai berdea (0-255) adierazten duen osoko adierazpena.

blue: Kolore konposatuaren osagai urdina (0-255) adierazten duen osoko adierazpena.

Emaitza gisa lortutako Long balioa honako formularen bidez kalkulatzen da:
Emaitza = gorriaĂ—65536 + berdeaĂ—256 + urdina.

warning

VBA bateragarritasun-moduan (Option VBASupport 1), Long balioa horrela kalkulatzen da:
Emaitza = gorria + berdeax256 + urdinax65536
Ikusi RGB funtzioa [VBA]


tip

Kolore-aukeratzailearen elkarrizketa-koadroak kolore-kode konposatu baten osagai gorri, berde eta urdinak kalkulatzen laguntzen du. Testuaren kolorea aldatuta eta Kolore pertsonalizatua hautatuta, kolore-aukeratzailearen elkarrizketa-koadroa bistaratzen da.


Return type:

Integer

Adibidea:


    YELLOW = bas.RGB(255,255,0)
  

Xray

Ikuskatu UNO objektuak edo aldagaiak.

Sintaxia:

svc.Xray(obj: any)

Parametroak:

obj: Aldagai bat edo UNO objektu bat.

Adibidea:


    bas.Xray(bas.StarDesktop)
  
warning

Azpimarraren karaktere bat, "_", aurrizki gisa duten ScriptForge Basic errutina edo identifikatzaile guztiak barneko erabilerarako erreserbatuta daude. Ez dira Basic makroetan edo Python scriptetan erabili behar.


Emaguzu laguntza!