TOPIC: User manual questions
#1073
User manual questions 2 Years, 7 Months ago
Hi,

I am working through the user manual's tutorials.

Just a couple of questions/observations so far:

I am up to the standalone instructions, but I have been confused by the reference to command line. I thought it meant a command in a DOS window. Now I think it means parameters added to the shortcut or a text script file. Am I right?

When I click on the Edit My Contacts tab and then close it, it contains a message:

ERROR: Unitilialized member 0
I have no idea what this means and why the fields are either a 1 or a zero.

Also in my tutorial example book sometimes clicking on one of the tabs opens up two instances of the window. I haven't been able to isolate a specific sequence of operations to cause this. Is this a known bug?

Apart from this I am enjoying this experiment and hope to be producing something useful soon...
 
 
#1079
Re:User manual questions 2 Years, 7 Months ago
You are right for the first question. They are parameters added to the shortcut (where suneido.exe is). Those commands can be used in a DOS window or a text script file.

For other errors, could you post your code here so I can check for the reason. As my very first guess, they are not bugs but I need read the code for sure.

Thanks.
 
 
#1080
Re:User manual questions 2 Years, 7 Months ago
Judy,

Thanks for the reply.

I have a feeling it was to do with this:

Code:


# (Access muzcontacts
title: "My Contacts"
(firstname group: 0) (lastname group: 1) nl
(phone group: 0) (fax group: 1) nl
(email group: 0) nl
(website group: 0)
)


I didn't understand the significance of the 0's and 1's
I am now working through the Going Further tab of the user manual.


In LibraryView create Field_ definitions for each field, for example:

Field_sale_amount

Field_dollars
{
}


I have added this to a new item in my library but I am getting a red dot. What am I doing wrong?
 
 
#1081
Re:User manual questions 2 Years, 7 Months ago
The code for your Access Control (My Contacts) looks fine. I'm wondering that the code in your book which links your book pages to the real code cause that error. Can you show me your book code, i.e. the Edit My Contacts tab?

The red dot shows a syntax error. For this example in the help book, "Field _sale_amount" is the record's (definition) name and

Field_dollars
{
}

is the code inside it, which means it is inherited from Field_dollars. The "... Field_ definitions ..." isn't one word and there is a space between them. It means that you need create definitions with prefix as "Field_".

Judy
 
 
#1082
Re:User manual questions 2 Years, 7 Months ago
Hi Judy,

I was a bit confused by your reply.

I added definitions to the library as follows:


This seemed to work, however I still do not know how to make the sale_id number automatically index to the next number (auto increment). I couldn't find a preset definition from the standard library to do this.

My access form is as shown:



One other question from the last post, what do the 0's and 1's represent in the mycontacts access example, ie


The code for my book is shown here:


Thanks for your help!

Supergrass
 
 
#1084
Re:User manual questions 2 Years, 7 Months ago
The group values in your example are used by FormControl to line up fields in vertical columns. All fields with a group value of 0 will be lined up in the first vertical column, fields with group value of 1 will be in the second column and so on. All fields in a row (between each nl - newline) must have unique group values.

To automatically increment your sale_id field, define a rule called Rule_sale_id.
Code:


function ()
{
return GetNextNumber("sale_nextnum", "sale_nextnum"')
}



The first argument to GetNextNumber is the table that holds the nextnum. The second argument is the field in the table where the next value is stored. You must create this table yourself and insert a record with the starting value. The key on this table should be an empty key since there will only ever be one record in it.

As for the book entry, try just putting the name of your Access definition as the book page code. If you use Window() it will actually create a new window separate from the book's window where the intention behind the book is that the book pages and content should be displayed within the book's window.
 
 
Jeff Ferguson
Suneido Software
 
#1085
Re:auto increment field 2 Years, 6 Months ago
Jeff,

Thanks for the explanation about the layout fields and the window command.
Removing the window command from my book tabs resolved that problem.

I have tried to implement your Rule_sales_id code and now I have a problem creating the access with this feature.

I created a table called sale_nextnum and created an access to it and input a single value of 100. I also created a "Rule_sale_id" item in Mylib with your code in it. I am now getting this error message:



I thought it might be because I had defined Field_sale_id as
Code:


Field_num
      {
      }



So I defined it as
Code:


Field_string
{
Prompt: 'Sale ID'
Control: (Field width: 15)
}



I now get a similar message "can't find field_sale_id control"
Could you please advise?

Regards,

Murray
 
 
#1086
Re:auto increment field 2 Years, 6 Months ago
Jeff,

Thanks for the explanation about the layout fields and the window command.
Removing the window command from my book tabs resolved that problem.

I have tried to implement your Rule_sales_id code and now I have a problem creating the access with this feature.

I created a table called sale_nextnum and created an access to it and input a single value of 100. I also created a "Rule_sale_id" item in Mylib with your code in it. I am now getting this error message:



I thought it might be because I had defined Field_sale_id as
Code:


Field_num
      {
      }



So I defined it as
Code:


Field_string
{
Prompt: 'Sale ID'
Control: (Field width: 15)
}



I now get a similar message "can't find field_sale_id control"
Could you please advise?

Regards,

Murray
 
 
#1087
Re:auto increment field 2 Years, 6 Months ago
Hi Murray,

It looks like you have #('Rule_sale_id', group: 0) in your control specification. You should only have the field name in the specification because Suneido automatically looks for a rule definition. You need something like the following:

#('sale_id', group: 0)
 
 
Jeff Ferguson
Suneido Software
 
#1088
Re:auto increment field 2 Years, 6 Months ago
Jeff,

Prior to my post I had changed the Sales_access to:
Code:


# (Access sales
title: "Sales Info"
(Field_sale_id group: 0)(Field_salesperson group: 1) nl
(Field_sale_city group: 0) (Field_sale_amount group: 1) nl
)

However then the message became: "can't find sales_id control"

My Field_sale_id code is:
Code:


Field_string
{
Prompt: 'Sale ID'
Control: (Field width: 15)
}



I then tried commenting the sale_id field out of the access:

Code:


# (Access sales
title: "Sales Info"
//(Field_sale_id group: 0)
(Field_salesperson group: 1) nl
(Field_sale_city group: 0) (Field_sale_amount group: 1) nl
)


the error message then became: can't find field_salespersoncontrol.

It seems like something else is going on.

I have attached my database, if you get a chance to look at it I would appreciate it.
 
 
#1089
Re: link to database file 2 Years, 6 Months ago
Sorry,

I have hosted the database file here :)

Regards,

supergrass
 
 
#1090
Re: link to database file 2 Years, 6 Months ago
You don't need put the prefix Field_ into the code where you want to use the field. Try to change the Sales_Access record to be

# (Access sales
title: "Sales Info"
(sale_id group: 0) (salesperson group: 1) nl
(sale_city group: 0) (sale_amount group: 1) nl
)

I loaded your databse, everything works fine and you may need add the field definition for sale_amount.

Judy
 
 
#1096
Re: user manual example - all working now 2 Years, 6 Months ago
Thanks Judy,

Its all working now!

One interesting side effect to the auto increment solution (not a big problem) is if you open and close the sales access without adding a new record, the sales id number increments regardless.

I will keep on working through the user manual.
Supergrass