Normal Topic Quick Way to Block off Fields (Read 849 times)
Blair Wettlaufer
Junior Member
Members
**
Offline


No personal text

Posts: 98
Location: Hamilton, ON
Joined: Jun 4th, 2005
Quick Way to Block off Fields
Oct 28th, 2005 at 8:41pm
Print Post Print Post  
Hi!

Currently I'm using the code below to restrict fields to certain user levels ... is there a simpler way to do it without so much coding?

Thanks!
Blair

Code
Select All
if @group = "Users" then
{
	Readonly(DBName,2)
	RGBColor(DBName,-1,-1,-1,204,204,204)
	Readonly(DBColl#,2)
	RGBColor(DBColl#,-1,-1,-1,204,204,204)
	Readonly(DBTrac#,2)
	RGBColor(DBTrac#,-1,-1,-1,204,204,204)
	Readonly(DBLgl#,2)
	RGBColor(DBLgl#,-1,-1,-1,204,204,204)
	Readonly(DBComRate,2)
	RGBColor(DBComRate,-1,-1,-1,204,204,204)
	Readonly(DBListed,2)
	RGBColor(DBListed,-1,-1,-1,204,204,204)
	Readonly(DBList,2)
	RGBColor(DBList,-1,-1,-1,204,204,204)
	Readonly(DBCrBu,2)
	RGBColor(DBCrBu,-1,-1,-1,204,204,204)
}
 

  

Coesper erat: tunc lubriciles altravia circum&&Urgebant gyros gimbiculosque tophi:&&Moestenui visae borogovides ire meatu:&&Et profugi gemitus exgrabuere rathae
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Quick Way to Block off Fields
Reply #1 - Oct 28th, 2005 at 9:07pm
Print Post Print Post  
You could cut it by half by using a user defined subroutine:

Code
Select All
subroutine WhackThis(le_name as string)
  SetThisElement(le_name)
  ReadOnly(ThisElement, 2)
  RGBColor(ThisElement, -1, -1, -1, 204, 204, 204)
  UnSetThisElement()
end subroutine
 



If you only have to do this with 8 LEs - its probably not a big deal. But if you really have 80 or 800, it'll be worth it. You could also create a list of the LEs that need to be affected and use that list with a loop, if you need to work on those LEs over and over again.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Blair Wettlaufer
Junior Member
Members
**
Offline


No personal text

Posts: 98
Location: Hamilton, ON
Joined: Jun 4th, 2005
Re: Quick Way to Block off Fields
Reply #2 - Oct 31st, 2005 at 1:35am
Print Post Print Post  
Subroutine implemented -- thanks!

Next question ... I want to have some fields read-only or unchangable, but I want the user to be able to enter the field and able to F6/expand the field.

Is there a simple solution to this? 

Thanks
Blair

PS - I bet you'll be glad when the rest of the team is back from the seminar to handle all these pesky questions, eh?
  

Coesper erat: tunc lubriciles altravia circum&&Urgebant gyros gimbiculosque tophi:&&Moestenui visae borogovides ire meatu:&&Et profugi gemitus exgrabuere rathae
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Quick Way to Block off Fields
Reply #3 - Oct 31st, 2005 at 2:26am
Print Post Print Post  
Quote:
Subroutine implemented -- thanks!

Next question ... I want to have some fields read-only or unchangable, but I want the user to be able to enter the field and able to F6/expand the field.

Is there a simple solution to this? 

Just off the top of my head - could you grab the value when the user enters the LE and restore it when they are done?
Quote:
Thanks
Blair

PS - I bet you'll be glad when the rest of the team is back from the seminar to handle all these pesky questions, eh?


Well, I'm really a systems programmer (make programs from scratch), not an application programmer (make existing programs do new and interesting things), so Erika and Ray are more qualified to answer a lot of these questions.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Blair Wettlaufer
Junior Member
Members
**
Offline


No personal text

Posts: 98
Location: Hamilton, ON
Joined: Jun 4th, 2005
Re: Quick Way to Block off Fields
Reply #4 - Oct 31st, 2005 at 3:49pm
Print Post Print Post  
How would I do that?

I could have on field entry

vTemp = NoTouchField

if NoTouchField <> vTemp
{
  NoTouchField = vTemp
}

But that wouldn't work, would it?  I'd need to check on field exit, not field entry, right?
  

Coesper erat: tunc lubriciles altravia circum&&Urgebant gyros gimbiculosque tophi:&&Moestenui visae borogovides ire meatu:&&Et profugi gemitus exgrabuere rathae
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Quick Way to Block off Fields
Reply #5 - Oct 31st, 2005 at 3:56pm
Print Post Print Post  
Declare a Static in GLOBAL CODE

Code
Select All
stat sSaveVal as String 



Grab the current value On Element Entry.

Code
Select All
sSaveVal = MyLE 



Put it back On Element Exit

Code
Select All
MyLE = sSaveVal 


  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Blair Wettlaufer
Junior Member
Members
**
Offline


No personal text

Posts: 98
Location: Hamilton, ON
Joined: Jun 4th, 2005
Re: Quick Way to Block off Fields
Reply #6 - Oct 31st, 2005 at 6:16pm
Print Post Print Post  
Perfect -- thanks!

Blair
  

Coesper erat: tunc lubriciles altravia circum&&Urgebant gyros gimbiculosque tophi:&&Moestenui visae borogovides ire meatu:&&Et profugi gemitus exgrabuere rathae
Back to top
 
IP Logged