Post by chrigigee on Sept 17, 2023 5:21:18 GMT -5
Dear Liberty Basic Community,
I dared to extract something from another application.
The origin of the application lies in the application "Contact Manager"
resp. the application "simple help".
resp. the application "simple help".
Well, I have become successful so far so that the "application" works in its original version.
But unfortunately only half.
But unfortunately only half.
The index for the help is originally 13 points.
If I let it start, there is an error message, "out of range"
I reduce this, as shown in the error report, the application runs perfectly to just 10 points.
If I let it start, there is an error message, "out of range"
I reduce this, as shown in the error report, the application runs perfectly to just 10 points.
So far I have not been able to find out what could be.
I have already spent half a day finding out where Omin could be a mistake.
I have already spent half a day finding out where Omin could be a mistake.
I am happy to add the code to you and someone sees my mistake.
I want to apologize for my bad English my main language is German and my English centories are not very good.
Kind regards
Christian
[Initialize]
'Global helpContents, contents$, contents, hContents$, ItemCount
Nomainwin
[setup.helpInfo.Window]
'-----Begin code for #main
CrLf$=Chr$(13)+Chr$(10)
ListboxColor$="PaleGray"
TextboxColor$="PaleGray"
Restore [helpContents]
For contents=1 To 13
Read contents$
hContents$(contents)=contents$
Next contents
StyleBits #help, 0, _WS_VISIBLE, 0, 0
Stylebits #help.explain, _WS_VSCROLL Or _ES_READONLY Or _ES_MULTILINE , _ES_AUTOHSCROLL, 0, 0 '
WindowWidth = 600
WindowHeight = 325
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
'-----Begin GUI objects code
StaticText #help, "Left click on a help topic", 10, 10, 150, 20
TextBox #help.explain, 170, 10, 415, 270
ListBox #help.contents, hContents$(, [getHelp], 10, 30, 145, 220
Button #help.close, " Exit Help ", [helpless], UL, 30, 256
Open "Diary Help" for window As #help
Print #help, "font ariel 10"
Print #help, "trapclose [helpless]"
Print #help.contents, "SingleClickSelect"
hHwnd=Hwnd(#help)
hcHwnd=Hwnd(#help.contents)
'-----End GUI objects code
Calldll#user32, "ShowScrollBar",_
hcHwnd As ULong,_
_SB_VERT As Long,_
0 As Boolean,_
success As Boolean
Calldll #user32, "MoveWindow",_
hHwnd As ULong,_
UpperLeftX As Long,_
UpperLeftY As Long,_
600 As Long,_
325 As Long,_
1 As Long,_
success As Long
calldll #user32, "ShowWindow",_
hHwnd As Long,_
1 As Long,_
success As Long
Restore [02]
Read ItemCount
For count=1 to ItemCount
Read explainIt$
If explainIt$="CrLf" then
showIt$=showIt$+CrLf$
else
showIt$=showIt$+explainIt$
End If
Next count
Print #help.explain, showIt$
Wait
[getHelp]
showIt$=""
Print #help.contents, "SelectionIndex? explainIndex"
Select Case explainIndex
Case 1
Restore [01]
Case 2
Restore [02]
Case 3
Restore [03]
Case 4
Restore [04]
Case 5
Restore [05]
Case 6
Restore [06]
Case 7
Restore [07]
Case 8
Restore [08]
Case 9
Restore [09]
Case 10
Restore [10]
Case 11
Restore [11]
Case 12
Restore [12]
End Select
Read ItemCount
For count=1 to ItemCount
Read explainIt$
If explainIt$="CrLf" then
showIt$=showIt$+CrLf$
else
showIt$=showIt$+explainIt$
End If
Next count
Print #help.explain, showIt$
Wait
[helpContents]
Data "What is Libby?", "Contact Manager?", "Adding Records", "Selecting Records"
Data "Setting the Stage", "Editing the Stage List", "Modifying Records"
Data "Filtering Records", "Saving Records", "Sorting Records", "Finding Duplicates"
Data "Deleting Records", "Backup Information"
[01]
Data 35, "CrLf", "WHAT IS LIBBY?", "CrLf", "CrLf", " Libby is a suite of open "
Data "source software, contributed by the Liberty BASIC community.", " The intent, "
Data "of this open source project, is to increase the public's awareness of Liberty "
Data "BASIC's true capabilities.", " It is toward this end, that I have offered "
Data "this program for placement, in the Libby open source project.", "CrLf", "CrLf"
Data "Kenneth J. Lewis, Sr.", "CrLf", "(EagleWings Software)"
Data "CrLf", "CrLf", "WHY CONTACT MANAGER?", "CrLf", "CrLf", " Contact Manager began as "
Data "a personal project.", " My intention, was to create a program that would aid "
Data "in managing and tracking contacts, for my business.", "CrLf", "CrLf", " I "
Data "started with 'contact3.bas', an example program that is included with Liberty BASIC."
Data " I rewrote the original code to take advantage of the features of 'Liberty BASIC "
Data "v4.xx'.", " I added and improved many features.", " Contact Manager grew into a "
Data "fairly nice program, so I decided I would offer it to the Libby project.", "CrLf"
[02]
Data 26, "CrLf", "WHAT IS CONTACT MANAGER?", "CrLf", "CrLf", " Contact Manager is "
Data "currently a medium featured program.", " It is designed to track business "
Data "contacts, and their current relationship to your company", "CrLf", "CrLf",
Data " It's current features include", "CrLf", "CrLf",
Data " ** New records are easy to add.", "CrLf", " ** Records can be filtered by "
Data "their current stage.", "CrLf", " ** Sort records by business name or by city."
Data "CrLf", " ** Records can be deleted on the fly.","CrLf", " **Select and "
Data "modify records easily.", "CrLf", " ** Edit the list of stages.", "CrLf"
[03]
Data 11, "CrLf", "ADDING RECORDS", "CrLf", "CrLf", " To add a new record, left click "
Data "the 'New Record' button in the lower left corner of the window.", " Or select 'new' "
Data "from the 'Records' menu.", " Fill out the desired information on the contact form."
Data " Then left click the 'Save Record' button in the lower right corner of the window."
Data " Or select 'save' from the 'Records' menu.",
[04]
Data 15, "CrLf", "SELECTING RECORDS", "CrLf", "CrLf", " To select a record to view in "
Data "the contact form, left click on the name of a business.", " This will fill the "
Data "form with the contacts information.", " The 'Date Last Modified' and 'Mailing "
Data "Date' fields can not be edited by the user.", " These are filled in automatically, "
Data "by the program.", " In order for the 'Mailing Date' to be accurate, the stage must "
Data "reflect the next stage that is to be completed, not the stage that has just been "
Data "completed."
[05]
Data 12, "CrLf", "SETTING THE STAGE", "CrLf", "CrLf", " To set a contact's stage, "
Data "select the stage, from the 'Stage' combobox, in the contact form.", " A word of "
Data "caution!", " The stage must be set to the next stage that is to be completed, "
Data "not the stage that has just been completed.", " Otherwise the 'Mailing Date' "
Data "will not accurately reflect the date, a mailing took place."
[06]
Data 19, "CrLf", "EDITING THE STAGE LIST", "CrLf", "CrLf", " To edit the list of "
Data "stages, from the 'Edit' menu select 'stage list'.", " This brings up the 'Stage "
Data "List' edit window.", " The current stage list will be displayed in the textboxes, "
Data "that correspond to the stage number.", " Stage 1, Stage 2 and Stage 3 "
Data "cannot be modified.", " The other stages can be changed by highlighting the old "
Data "stage name, and typing in a new stage name.", "CrLf", "CrLf", " I hope that "
Data "adding the ability to edit the stage list, will make this program appeal to a wider "
Data "group of users."
[07]
Data 19, "CrLf", "MODIFYING RECORDS", "CrLf", "CrLf", " To modify a record, left "
Data "click a record in the contact list.", " Change the necessary information in the "
Data "contact form.", " Then left click the 'Save Record' button in the lower right "
Data "corner of the window.", " Or select 'save' from the 'Records' menu.", "CrLf"
Data "CrLf", " The 'Date Last Modified' and 'Mailing Date' fields can not be edited "
Data "by the user.", " These are filled in automatically, by the program.", " In "
Data "order for the 'Mailing Date' to be accurate, the stage must reflect the next stage "
Data "that is to be completed, not the stage that has just been completed."
[08]
Data 8, "CrLf", "FILTERING RECORDS", "CrLf", "CrLf", " Records can be filtered, for "
Data "the contact list, by selecting a stage from the 'Filter Contacts' combobox."
Data " This will filter the contacts by the stage selected, and display only those "
Data "contacts, whose stage matches the filter."
[09]
Data 8, "CrLf", "SAVING RECORDS", "CrLf", "CrLf", " To save a new or modified "
Data "record, left click on the 'Save Record' button in the lower right corner of the "
Data "window.", " Or select 'save' from the 'Records' menu."
[10]
Data 22, "CrLf", "SORTING RECORDS", "CrLf", "CrLf", " Records can be sorted by "
Data "business name, or by the city listed in their address.", " Select 'sort' from "
Data "the 'Records' menu.", " You will be presented with a popup menu.", " Select "
Data "either 'name sort', or 'city sort'.", "CrLf", "CrLf", " 'name sort' ", "CrLf"
Data " Sorts your contacts, alphabetically by business name.", "CrLf", "CrLf"
Data " 'city sort' ", "CrLf", " Groups your contacts by city, with the city "
Data "sorted alphabetically.",
[11]
Data 26, "CrLf", "FINDING DUPLICATES", "CrLf", "CrLf", " To find duplicate records, "
Data "left click on the 'Find Duplicates' button at the bottom center of the window."
Data " This will add a duplicates listbox to the right side of the window.", " It is "
Data "recomended that you sort the contact list, by business name, first.", " This will "
Data "place any duplicate records next to each other.", " Making the duplicate easier "
Data "to locate.", "CrLf", "CrLf", " When the list is populated, left click on a "
Data "contact in the duplicates list.", " The corresponding entry will then be brought "
Data "into view near the bottom of the contacts list.", " At this point you can left "
Data "click on each record to view the records one at a time, and decide which one to "
Data "keep.", " Left click on the record that is to be eliminated, and either replace "
Data "the information in the contacts form with a new record, or delete the record."
Data " (see 'DELETING RECORDS' in the 'help' section of the 'Help' menu).", "CrLf"
[12]
Data 13, "CrLf", "DELETING RECORDS", "CrLf", "CrLf", " Records can be deleted by "
Data "first, selecting a record from the contact list.", " This displays the contact's "
Data "information in the contact form.", " After reviewing the record, select 'delete' "
Data "from the 'Records' menu.", " You will be prompted to confirm the record deletion."
Data " Left click the 'yes' button to delete the record, or left click the 'no' button, "
Data "to keep the record."
[13]
Data 44, "CrLf", "BACKUP INFORMATION", "CrLf", "CrLf", " This program uses a double "
Data "backup system.", " Whenever one of the following actions occurs, the data file "
Data "is backed up as 'contact4.bak'.", " If 'contact4.bak' already exists, it is renamed "
Data "as 'contact4old.bak'.", " This way the last two backups are always available."
Data "CrLf", "CrLf", " The actions that trigger a backup are...", "CrLf"
Data " **Starting the program", "CrLf", " **Saving a new record", "CrLf"
Data " **Saving a modified record", "CrLf"," **Deleting a record", "CrLf", "CrLf"
Data " In addition Whenever you sort the records, the data file is backed up as "
Data "'contact4recover.bak'.", " If 'contact4recover.bak' already exists, it is renamed "
Data "as 'contact4recoverold.bak'.", " This provides two additional backup files to "
Data "recover records from, in the event of a system crash.", " Any one of these files "
Data "can be renamed as 'contact4.dat' to recover data from them.", " Of course if "
Data "'contact4.dat' still exists, it will have to be renamed first.", " I suggest "
Data "something like contact4.old.", "CrLf", "CrLf", " Normal usage of the program "
Data "will usually cause 'contact4.bak' and 'contact4old.bak' to be the most recent "
Data "backups.", " However if you have just sorted the records, then "
Data "'contact4recover.bak' and 'contact4recoverold.bak' will be the most recent.", "CrLf"
[helpless]
Close #help
End