SoFunction
Updated on 2025-04-11

Detailed explanation of the multi-threaded module of Easy Language

Essential module

Subprogram name: thread_start

[First Pin] xc_qd

[Remark] Returns the thread handle successfully, returns 0 if failed

【Call Format】

〖Return value type〗 Integer type

<Return value> Thread_Start (the subroutine to be started, the parameters of the subroutine must be passed)

"Parameter description" Number of parameters: 2

Parameter 1: Subroutine to be started, subroutine pointer

Parameter 2: To pass the parameters of the subroutine, integer type, can be empty, and pass an integer type parameter into the subroutine

You can pass an integer parameter

If you need to pass text

You can pass the address of the text variable over and get the pointer address_text type ()

Then use a pointer to text to restore it to text. Pointer_to text

Zichuanxiu Multi-threaded

Split text: text type array, global variable

Split text = Split text (edit box. content, #line break,)

Record the first loop (take the number of array members (segment text), i)

Temporary table entry = super list box 1. Insert table entry (,,,,,)

Super list box 1. Set the title (temporary table item, 0, split text [i]) //The title and table items of the super list box are calculated from 0

Super List Box 1. Set the title (temporary entry, 1, "Wang Huajun")

Calculate the cycle //Insert the super list box item, each item is from left to right [0,1~~] and set the title again

Process text (super list box 1)

Processing text ()

The counting cycle starts (to process the list box. Take the number of table items (), i)

Temporary text = To process the list box. Take the title (i-1,0)

Temporary Operator = To process the list box. Take the title (i-1,1)

Insert the target editing box (i, temporary text, temporary operator) (General processing) // Start thread (&Multi-threaded insertion target editing box (), i) (Multi-threaded processing)

Calculate the cycle

Multithreaded insertion target edit box () Parameter name: Parameter

//Text content = super list box. Take the title (parameters -1,0)

//Operator=Super list box. Take the title (parameters -1,1)

If true (parameter = 1)

Edit box 1. Content = Text content

Edit Box 5. Content = Operator