Normal Topic Readonly() (Read 590 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Readonly()
Sep 15th, 2005 at 5:02am
Print Post Print Post  
I have an element named FirmName on a tab.
I have a command button named Add new firm with sbasic of:

var nn as int

nn = @FormNewRecord("Firm")
throwfocus(firmName)

when you are in update mode if I press Add new firm it creates my new record perfect.

I needed to stop the users from accidentally changing the firm name. (often they forget to press f7 and enter search criteria over the existing Firm name)

One option I thought of using was the Readonly() command. I thought that if I tested for a blank FirmName element on element entry and set my read only to 0 or 1 it would make the firm name read only if it was not blank and when I pressed my command button Add new firm the element would be blank and read only would be set to write.

This is the code I used but it does not work. Can you please tell me where my thought process failed?  ???

Thanks


var vint as int

     If Not @isBlank(Firmname)
     {
     vint = 1
     //Writeln(Vint)
     Readonly(firmname,vint)
     }

     else
     
     {
     vint = 0
     //Writeln(Vint)
     Readonly(firmname,vint)      
     }


Amongst dozens of others I also tried this:

var vint as int

     If Not @isBlank(Firmname)
     {

     vint = 1
     Writeln(Vint)
     Readonly(firmname,vint)
     }

     else

     If  @isBlank(Firmname)
     
     {
     vint = 0
     Writeln(Vint)
     Readonly(firmname,vint)      
     }
     
            
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Readonly()
Reply #1 - Nov 23rd, 2005 at 3:00am
Print Post Print Post  
Robert,
Did you get an answer to this issue. I Just tried your first example in a form here and it seemed to work.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Readonly()
Reply #2 - Nov 23rd, 2005 at 3:32pm
Print Post Print Post  
Quote:
Robert,
Did you get an answer to this issue. I Just tried your first example in a form here and it seemed to work.

Mark,

Thank you very much for checking.

I was never able to get this working as posted. Ray looked at this during the conference and came up with an alternative that worked. I am not sure why it works for you, but maybe Ray can explain to you why it would not work in my application.

I wish you your family and the rest of your terrific team a happy Thanksgiving.

I know this has been said before by many of us users however I will state it once again. We sure are thankful for you, Erika, Ray and the rest of the great creators, developers, and support team at Lantica.  Thank you all for your hard work and for bringing us such a great product.  Smiley

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged