[Gambas-user] TableView.text conversion
I have input a value into a TableView cell, and now I want to read it. The problem is that I want to read it as a text string. The 'number' is actually an ISBN code. It can sometimes be a string, as it can contain an 'X' or a 10 digit number, but starting with a 0. For example, 0123456789, 1234567891, and 012345678X are all valid values for the cell. So, when the cell value is say 0123456789 and I convert it with str$, I get 123456789, the zero is dropped. Is there an easy way around this or do I have to check the leading character each time for a '0'? Thanks, Keith -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] TableView.text conversion
Keith Clark wrote: I have input a value into a TableView cell, and now I want to read it. The problem is that I want to read it as a text string. The 'number' is actually an ISBN code. It can sometimes be a string, as it can contain an 'X' or a 10 digit number, but starting with a 0. For example, 0123456789, 1234567891, and 012345678X are all valid values for the cell. So, when the cell value is say 0123456789 and I convert it with str$, I get 123456789, the zero is dropped. Is there an easy way around this or do I have to check the leading character each time for a '0'? Thanks, Keith Hi Keith, Since Jan 2007 ISBN numbers have been 13 digits and should consist of 5 parts with each section being separated by spaces or hyphens. Because of this, your ISBN numbers will always be stored and displayed as strings. There is no conversion needed. -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] TableView.text conversion
Keith Clark wrote: Les, Thanks, but I found that that was not actually my problem. The problem showed up in sending data to a field in my database. I just forgot to surround the field with single quotes! Sometimes the simplest problem is hard to see! Keith Yes, if its a string it will be ok. I have some very simple gambas code for a 10 to 13 digit conversion, if it is of any use to you. Regards Les -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user