Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the easy language programming command call operations?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the easy language programming command call operation, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.

I. Overview of commands

1. What is a command: a command is the beginning of a function call.

two。 Parameters of a command: the data or conditions entered when a function method is called.

3. The return value of the command: the output obtained after calling the function method.

Second, the format of the command

1. Format: [return value] [owning object] command name ([parameter 1], [parameter 2],.).

two。 Note: [] refers to something you can have but not necessarily have.

3. Example: return (1).

Third, the parameters of the command

1. Parameters can be either constants or variables.

two。 The parameter passed to the command must meet the definition of the command. For example, in the example of "input (text type)", the parameter passed must be in text format, otherwise a syntax error will occur.

3. Not all commands require parameters, that is, there are commands that do not require parameters, but the "()" after the command name and the separator between multiple parameters, "cannot be done without.

4. In actual development, you don't need to memorize all the commands, just press F1 to view the bright instant help documentation for command instructions.

Fourth, the return value of the command

1. Most commands will have a return value after execution, that is, not all commands will have a return value at the end of the command.

two。 Some commands return operation results, some commands return feedback after execution, and some commands return logical judgment.

3. The data type of the return value of the command is determined by the syntax of the command. In actual development, it is often necessary to convert the data type of the return value, such as the edit box displays only text. Then to display numbers, you need to use the "to text ()" command for conversion.

Program: multiple selection and scrolling line writing

. Version 2. Assembly window assembly _ startup window. Subroutine _ button 1 _ is clicked 'artboard 1. Scroll to write lines (multiple selections (3, "A", 666, [September 9, 2018]) 'artboard 1. Scroll to write lines (multiple selections (2, "A", 666, [September 9, 2018])) artboard 1. Scroll to write lines (multiple selections (1, "A", 666, [September 9, 2018]). Subroutine _ button 2 _ is clicked artboard 1. Scroll to write lines (multiple selections (2, "A", 666, [September 9, 2018]). Subroutine _ button 3 _ is clicked artboard 1. Scrolling line writing (multiple selections (3, "A", 666, [September 9, 2018]) 'scrolling line writing is line wrapping input' is to choose from the following items. 5. Command nesting call

1. Commands can be used in nesting, which means that the parameters of a command can be the return value of another command

two。 Example: edit box 1. Content = to text (to numeric value (edit box 1. Content) + 1)

Array parameters and array return values

1. Array parameters: sometimes the parameter of a command must be an array variable, such as the "redefine array ()" command

Program: player 3

. Version 2. Assembly window assembly _ startup window. Subroutine _ button 1 _ is clicked. Local variable playlist variable, text type, "6" 'realize multiple songs continuous playlist variable through array variable = {"F:\ CloudMusic\ Ace combination-Chudi no song .mp3", "F:\ CloudMusic\ FLOW,GRANRODEO-Howling.mp3", "F:\ CloudMusic\ Gemie" SawanoHiroyuki [nZk]-X.U.mp3 "} 'the music to be played needs to be in the same folder as the program file.' play MP3 (1," Hakai Shimai-meteor .mp3 "). What if I try not to be in the same folder? Add a full path to try 'play MP3 (1, "F:\ CloudMusic\ Ace combination-Chu No songs. Mp3") successfully! Cross-folder mp3 playback can also be achieved by adding full path. 'try to play other music without modifying the source code?' I haven't tried it yet.' The above is the code of my player one written before, now upgrade my player one _ startup window. Background music = {} _ launch window. Bottom image = # Picture 2 play MP3 (1, playlist variable). Subroutine _ _ startup window _ created _ startup window. Base image = # Picture 1 'through the above code, you can switch background images during playback. By the same token, you can also switch background music.' you can click different buttons to switch background pictures and background music to achieve the song-ordering effect similar to that of a music player. 'can you further consider the display function of the lyrics?

two。 Array return values: the return values of some commands are array variables such as "split text ()" command

7. Process control commands

Process control commands are divided into three categories: branch class, loop class and jump class.

1. Branch class: if (), if true (), judge ()

two。 Cycle class: judgment cycle first (), cycle judgment first (), count cycle first (), variable cycle head ()

3. Jump class: to the end of the loop (), jump out of the loop (), return (), end ()

8. Arithmetic operation command

Arithmetic operation commands can be divided into basic arithmetic operation commands and extended arithmetic operation commands.

1. Basic arithmetic commands: add (+), subtract (-), multiply (×), divide (/), divide (\), find the remainder (%)

two。 Extended arithmetic operation commands: sign, absolute value, rounding, absolute rounding, power, square root, sine, cosine, tangent, inverse tangent, natural logarithm, inverse number, whether the operation is correct, random number seed, random number

IX. Logical comparison

Logical comparison commands in easy language can only compare basic data types, namely: byte type, short integer type, integer type, long integer type, decimal type, double precision decimal type, subroutine pointer, logical type, text type, byte set star type, date and time type.

1. Logical comparison commands: equal to, not equal to, less than, greater than, less than or equal to, greater than or equal to, approximately equal to, and, or, reverse

10. Bit operation command

Bit operation refers to the binary bit-by-bit operation of data.

1. Common bit operation commands are: bit inversion, bit and, bit OR, bit XOR, left shift, right shift, merge integers, merge short integers.

Array operation command

1. Common array operation commands are: redefine array, take the number of array members, take array subscript, copy array, join member, insert member, delete member, clear array, array sort, array zero.

Environmental access commands

Common environment access commands: take command line, run directory, execute file name, read environment variable, write environment variable

13. Pinyin processing command

1. The common Pinyin processing commands are: take all pronunciation, take the number of pronunciation, take Pinyin, take the initial consonant, take the vowel, compare pronunciation, compare input words.

two。 In order to match the uppercase and lowercase letters in the target text, use the corresponding uppercase letters at the appropriate location, such as "jsjA" matches "computer a" and "computer A"

3. To match half-width digits in the target text, use a return number at the appropriate location, such as "jsj1" matches "computer 1"

4. In order to match the Chinese characters in the target text or the Chinese characters that do not know their pronunciation, the Chinese characters need to be used in the corresponding position, such as "j calculates J1" matches "computer 1"

5. Pinyin input cannot contain all half-width symbols except "_"

14. Text operation command

1. Standard ASCII table

two。 Common text manipulation commands are:

Take the length of the text, the left side of the text, the right side of the text, the middle of the text,

Characters, take codes, find text, find text upside down,

To uppercase, to lowercase, to full width, to half width, to text,

Delete head space, delete tail space, delete head and tail space, delete all blank,

Text replacement, subtext replacement, blank text, duplicate text,

Text comparison, split text, pointer to text

Time operation command

Common time operation commands are: time to time, increase or decrease time, take time interval, take the number of days in a month,

Time to text, time part, year, month, day, day, hour,

Take minutes, seconds, specified time, current time, current time, date, time

XVI. Numerical conversion command

Common numerical conversion commands are: to numeric, numeric to uppercase, numeric to amount, numeric to formatted text,

Take hexadecimal text, octal text, to bytes, to short integers, to integers, to long integers, to decimals,

Byte set operation command

Common byte set operation commands are: take byte set length, to byte set,

Take the byte set data, the left side of the byte set, the right side of the byte set, the middle of the byte set,

Find byte set, invert byte set, byte set replacement, subbyte set substitution,

Take blank byte set, repeat byte set, split byte set, pointer to byte set

18. Disk operation command

1. Absolute and relative paths:

The path that fully describes the location of the file is the absolute path, such as F:\ easy language exercise

The path relationship between a file (program) and other files (folders) caused by the path where a file (program) is located is called a relative path, such as F:\ easy language exercise\ New folder, which can be F:\ easy language exercise relative path\ New folder

two。 Common disk operation commands are:

Take the total disk space, take the remaining disk space, take the disk volume label, set the disk volume label,

Change the drive, change the directory, take the current directory, create the directory, delete the directory,

Copy files, move files, delete files, rename files, whether files exist,

Find the file to take the file time, take the file size, take the file attribute, set the file attribute,

Take a temporary file name, read a file, write to a file

XIX. File read and write commands

Common file read and write commands are:

Open files, open memory files, close files, close all files,

Lock the file, unlock the file, move the read and write location, move to the beginning of the file, move to the end of the file,

Read in byte set, write out byte set, read in text, write out text, read in one line,

Write lines of text, read in data, write out data, whether at the end of the file,

Take read and write position, take file length, insert byte set, insert text, insert text lines,

Delete data, open encrypted files

20. System processing commands

1. Clipping board

two。 Registration form

3. Common system processing commands:

Run, take the clipboard text, set the clipboard text, take the text in the clipboard, clear the clipboard, take the screen width, take the screen height, take the horizontal position of the mouse, remove the vertical position of the mouse, take the number of colors, input box, information box, tweet, take startup time, set waiting mouse, restore mouse, delay, take text registration key, take numerical registration key, take byte set registration key, write registration key, delete table entry, Whether the registration key exists, default background color, snapshot, read configuration item, write configuration item, configuration node name, operating system category, multi-file dialog box

21. Media playback command

1. Common audio formats:

① WAV: a sound file format developed by Microsoft that conforms to the RIFF file specification

② MIDI: musical instrument digital interface, early proposed to solve the problem of communication between electroacoustic instruments.

③ MP3: moving Image expert Compression Standard Audio layer 3, is a popular audio coding and lossy compression format.

two。 Media playback commands:

Play music, stop playing, play MID, play MP3, play MP3 synchronously,

Pause playback of MP3, resume playback of MP3, and take playback status of MP3

22. Network communication commands

Common network communication commands: take hostname, communication test, convert hostname, convert to IP address

23, other commands

Other common commands: standard output, standard input, intercept, selection, multiple selection, empty, created, take data type size, take color value, take event component, event transfer, handle event, intercept picture, uninstall picture, take hard disk character, fetch system language, write to memory, DLL command call redirection, set error prompt management, set DLL load directory, take component name, take object type, Look for components, get the number of components found, get the components found, place the code

24, the third generation of my player (modified)

Program: three changes to the player

. Version 2. Assembly window assembly _ startup window. Subroutine _ button _ play _ is clicked. Local variable MP3 filegroup, text type, "0" MP3 filegroup = multi-file dialog box ("Please add mp3 files you want to play", "mp3 files (* .mp3) | * .mp3", true). Returns () if true (number of array members (MP3 filegroup) = 0). If you really end playing MP3 (- 1, MP3 filegroup) 'the commands involved here are: multi-file dialog box, if true, take the number of array members, return, play MP3' one, multi-file dialog box call format: 'display a file open dialog box, allow the user to select or enter multiple existing files that need to be opened, and return the result text array selected or entered by the user.' If the user does not enter or press the cancel button to exit, an array of empty text with 0 members is returned. 'The name of the parameter is "title" and the type is "text" and can be omitted. Specifies the title of the file opening dialog box. If omitted, the default is "Please enter the file you want to open:". The name of the parameter is "filter" and the type is "text" and can be omitted. Filter text consists of single or multiple pairs of text strings, the first description of each pair of text strings is displayed, such as "text file (* .txt)", and the second specifies the actual filter match, such as "* .txt". All text strings are separated by the "|" sign. If omitted, there is no filter by default.' The name of the parameter is "initial filter" and the type is "int" and can be omitted. If the previous parameter provides valid filter text, this parameter is used to specify the initial filter, with 0 as the first filter. If omitted, the default value is 0.' The name of the parameter is "initial directory" and the type is "text" and can be omitted. Specifies the directory to jump to automatically when the dialog box is opened. If omitted, it defaults to the current directory. The name of the parameter is "do not change the directory" and the type is "bool", which can be omitted. Specifies whether to automatically return to the file directory before entering the dialog box after the dialog box is closed, and if omitted, the default value is false.' The name of the parameter is "parent window" and the type is "all" and can be omitted. Specifies the parent window of the dialog box, which can be a window type data or an integer window handle. If omitted, the default is none. "if true" call format: "No return value > if true (logical condition)" this command decides whether to change the execution position of the program according to the value of the logic parameter provided, and if the value of the logic parameter provided is true, the program continues to execute sequentially, otherwise jump to the command pointed to by the left arrow line.' Compared with the "if" command, this command does not have a false part of the program. 'The name of the parameter is condition and the type is bool. The result of this condition value determines the location of the next program execution. 'three, take the number of array members' call format: < integer > take the number of array members (universal variables / variables array to check) 'take the number of all members of the specified array variable, if the variable is not an array, return-1, so this command can also be used to check whether the specified variable is an array variable. The name of the parameter is "variable to check" and the type is "all". Only variables and arrays of variables can be provided when providing parameter data. The parameter value specifies the array variable whose number of members you want to check or whether it is an array. 4. Return 'call format: < No return value > return ([generic return to the caller's value]) this command transfers the current program execution position to the next statement of the calling subroutine statement, and can return a value to the subroutine call place as needed. The name of the parameter is "value returned to the caller" and the type is "all", which can be omitted. '5. Play MP3' call format: < No return value > play MP3 ([integer playback times], text array / non-array MP3 file name to be played,...) 'can automatically play multiple MP3 music files in succession. The last parameter in the command parameter table can be added repeatedly.' The name of the parameter is "number of plays" and the type is "int", which can be omitted. A value of-1 means that the specified music will be played in a loop, otherwise only the specified times will be played. If this parameter is omitted, the default value is 1.' The name of the parameter is "MP3 file name to be played" and the type is "text". You can provide both array and non-array data when providing parameter data. Although it is possible to display the name of the selected music in this way, it shows the full path and if it is played by a list, the contents of the edit box cannot be automatically updated. Edit box 1. Content = MP3 filegroup [take array subscript (MP3 filegroup, 1)]. Subroutine _ _ startup window _ created _ startup window. Background image = background picture of # player _ launch window. Background music = {} edit box 1. Content = "Please choose your favorite music!" Play MP3 (1, "F:\ easy language exercise\ VariousArtists-Warriors like the Wind .mp3") because the current music format is mp3, and the resource audio of easy language requires WAV format, so we can only use other methods to achieve the function of background music. The command "play music" can only play audio in WAV and MID format, so use the command "play MP3" here. Subroutine _ button _ pause _ is clicked to pause MP3 (). Subroutine _ button 3 _ is clicked to continue playing MP3 (). Subroutine _ button _ other _ is clicked to stop playing () edit box 1. Content = "Please choose your favorite music!" Thank you for reading this article carefully. I hope the article "what are the easy language programming command call operations" shared by the editor will be helpful to everyone? at the same time, I also hope that you will support and pay attention to the industry information channel. more related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report