Encountered a confusing error message? Please post here
We plan to improve Basic4ppc error checking and especially to refine the error messages in the next version.
So if you have encountered a confusing error message please reply to this post and also add the code that created the error message.
Thank you
I have just loaded basic4ppc onto my new samsung omnia and Im encountering this error . an error occurred on sub main app_start .
line number 20
table10.loadcsv ("fooddat.csv",",",false true)
Error description : an error message cannot be displayed because an optional resource assembly containing it cannot be found
Continue?
I have just loaded basic4ppc onto my new samsung omnia and Im encountering this error . an error occurred on sub main app_start .
line number 20
table10.loadcsv ("fooddat.csv",",",false true)
Error description : an error message cannot be displayed because an optional resource assembly containing it cannot be found
Continue?
In my last post I forgot to put the "," between the words false and true. I do need both because I have no header and I want the column names to be "Column1, column2, etc.
From Main Help:
Quote:
Loads data to the Table from a CSV file.
Syntax: LoadCSV (File Name, Separator Character, Header Exist, Create Columns)
Separator Character - The character that is used to separate between the values. Usually , (comma)
Header Exist - A boolean that tells if the first row in the file is the columns names (header values) or the file contains only the data.
Create Columns - If set to True, new columns will be created (type - cString). If false the current columns will remain and the data will be added. In the second case the column number and type must match the data.
If HeaderExist is True and CreateColumns is True: New columns will be created named as the values of the first row in file.
If HeaderExist is True and CreateColumns is False: The data will be added to the current columns ignoring the first row in file.
If HeaderExist is False and CreateColumns is True: New columns will be created named Column1, Column2...
If HeaderExist is False and CreateColumns is False: The data will be added to the current columns including the first row in file.
Example:
Table1.LoadCSV ("data.csv", ",", True, True)
Sub txtCustomer_LostFocus 'Using tblProducts to hold temporary Data txt=txtCustomer.Text command.CommandText="SELECT [Customer Code], [Customer], [Address] FROM [Custs] WHERE [Customer Code] LIKE '%" & txt &"%'" Command.ExecuteTable("tblProducts",0) 'Now load the table values into the label control txtCustName.Text=tblProducts.Cell("Customer", 0) txtCustAddress.Text=tblProducts.Cell("Address", 0) CustCode=tblProducts.Cell("Customer Code", 0) 'Set the combo Control To correct Code For i = 0To cboCust.Count-1 If cboCust.Item (i) = CustCode Then cboCust.SelectedIndex=i Exit EndIf Next btnAccept.Enabled=True End Sub
When i type in any letter up to trea the code works but if i type in the next letter which is s as in treas then the code does not work
So if i type in t i get 'treasure'
also any other letter in the word up to and including a gives me the same correct result. But when i type in the s the code gives me this error
an error occured on sub main txtCustomer_LostFocus
line no 229
txtCustName.Text=tblProducts.Cell("Customer", 0)
error description:
Index 0 is either negative or above rows count.
Maybe no rows are returning in this case?
You can check tblProducts.RowCount to see the number of rows in the table.
Thanks for the reply Erel,
I assumed that that was the case but i cannot understand why no rows are returned for treas when looking for the word treasure but a row is returned for the shorter version 'trea'
Can you shed any light on this because when a search is performed i do not know how ppl will do a search for a particular record
Last edited by Smee : 09-15-2009 at 10:09 AM.
Reason: Unclear explanation for more info
I was inadvertently testing against the Customer Code field which is an indexed field of 5 characters instead of the Customer field hence it only allowed the 'trea' and no further. The index for that field is G12TREA.
This simple program returns the wrong result, without error, in the IDE but fails optimised comilation indicating that the error is on the "End Sub" of App_start whereas it's the semicolon at the end of the line in the For loop that is the problem.
Code:
Sub Globals End Sub
Sub App_Start Msgbox(DoMaths) End Sub
Sub DoMaths For i = 0To10 l = l + i; Next Return l End Sub
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.