Author: Xingda Computer technology company (www.study01job.com) Guo Baoli
The feature of the wizard is that you need to do the work step-by-step, depending on the user's choice, often requiring multiple window collaborations, and allowing the user to back up and forward. No matter what kind of operation, if it has been done, you have to restore the original interface. Therefore, the development of the wizard needs to consider the following questions:
1, how many windows open;
2, how to control the user forward, back, there is no limit to the number of times;
3, how to restore the original operating interface.
This article gives a routine of the previous two questions, and the 3rd question is discussed later. This article is my forum in the ' General Query final version ' of the development process of the technical summary.
String ls_msg
String Ls_select
String Ls_where
Datastore Ldst_result
String Ls_syntax
String ls_errmsg
String Las_newparm[6]
String Las_oldparm[3]
String las_window[]
Window Lw_now
Integer Li_index
Str_frommain lstr_frommain//struct type,
Str_tomain lstr_tomain//struct type. These two struct types are described in a later article, where the main
To solve the 3rd problem mentioned above.
Boolean lb_cancel = False
Las_window[1] = ' w_start '//Next: N1 (using existing query)/N2 (new query); previous step: none; Cancel: C
LAS_WINDOW[2] = ' w_selecttables '//Next: Len () > 1; previous step: P; Cancel: C
LAS_WINDOW[3] = ' w_selectcolumns '//Next: Len () > 1; previous step: P; Cancel: C
LAS_WINDOW[4] = ' w_where '//Next: Len () > 1; previous step: P; Cancel: C
LAS_WINDOW[5] = ' w_savesql '//Next: N; previous step: P; Cancel: C
LAS_WINDOW[6] = ' w_finish '//previous step: P; complete: F; Cancel: C
Li_index = 1
Do While Li_index <> 7
If las_newparm[li_index] = ' or IsNull (Las_newparm[li_index]) then
Lstr_frommain.msg_dangqian = ' '
Else
Lstr_frommain.msg_dangqian = Las_newparm[li_index]
End If
If Li_index = 1 Then
Lstr_frommain.msg_shangyige = ' '
Else
Lstr_frommain.msg_shangyige = las_newparm[li_index-1]//Assign information to a member variable of a struct type Msg_shangyige
End If
Openwithparm (Lw_now,lstr_frommain,las_window[li_index])//lstr_frommain Accept Data
Lstr_tomain = Message.powerobjectparm
If Lstr_tomain.flag = ' N ' Then
Las_newparm[li_index] = lstr_tomain.msg//Next
Li_index + +
ElseIf lstr_tomain.flag = ' P ' then//previous step
Li_index--
ElseIf lstr_tomain.flag = ' C ' Then
Lb_cancel = True
Li_index = 7
End If
Loop
Close (This)
If not Lb_cancel then
Open (W_result)
End If