corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Scripting:


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Scripting:
Daniel_Corsa
Premium Member

Avatar

Registered: 21st Apr 04
Location: Wigton, Cumbria
User status: Offline
26th Oct 11 at 18:57   View Garage View User's Profile U2U Member Reply With Quote

On with rolling out autosignatures at work using AD.

We have it set so picks up all basic info

Name | Job | Division | Address |
Tel: +44**** | Fax: +44****

Only certain members of staff wish to display their mobile numbers, the above is obviosuly fairly basic but how would I go about if AD has the mobile field filled in, it adds "Mob:" then number

So for users without a mobile they get above and for users with a mobile they get the following;

Name | Job | Division | Address |
Tel: +44**** | Mob: +44**** | Fax: +44****

Whats best way to do this, I have template set at the moment so have Tel: _______ | Fax: _____ if I were to use plainTextFile.WriteLine(“| Mob: ” & objLDAPUser.mobile)

How would I get that to only show if Mobile field has a value? and skip if no value.

Sorry, this is probably really simple or me being thick!


April '06' Corsasport Feature Car | Aug '08' Total Vauxhall Feature Car | Spring '09' Fast Car Feature Car
Dom
Member

Registered: 13th Sep 03
User status: Offline
26th Oct 11 at 19:08   View User's Profile U2U Member Reply With Quote

Use an IF statement with a condition to check if the objLDAPUser.mobile variable is empty or not.

ie -
code:
If objLDAPUser.mobile IsNot Nothing Then TextFile.WriteLine(“| Mob: ” & objLDAPUser.mobile)

or

If Not (isempty(objLDAPUser.mobile)) Then TextFile.WriteLine(“| Mob: ” & objLDAPUser.mobile)




[Edited on 26-10-2011 by Dom]
Daniel_Corsa
Premium Member

Avatar

Registered: 21st Apr 04
Location: Wigton, Cumbria
User status: Offline
26th Oct 11 at 22:21   View Garage View User's Profile U2U Member Reply With Quote

Shall try that out in morning Dom, cheers!


April '06' Corsasport Feature Car | Aug '08' Total Vauxhall Feature Car | Spring '09' Fast Car Feature Car
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
26th Oct 11 at 22:59   View Garage View User's Profile U2U Member Reply With Quote

But don't use wonky quotes.
Daniel_Corsa
Premium Member

Avatar

Registered: 21st Apr 04
Location: Wigton, Cumbria
User status: Offline
27th Oct 11 at 15:38   View Garage View User's Profile U2U Member Reply With Quote

Working now thanks Dom!

[Edited on 27-10-2011 by Daniel_Corsa]


April '06' Corsasport Feature Car | Aug '08' Total Vauxhall Feature Car | Spring '09' Fast Car Feature Car
Dom
Member

Registered: 13th Sep 03
User status: Offline
27th Oct 11 at 17:20   View User's Profile U2U Member Reply With Quote

Could try -
code:
If Not objLDAPUser.mobile = empty Then TextFile.WriteLine("| Mob: " & objLDAPUser.mobile)

Might be worth checking that objLDAPUser.mobile is returning as empty on a blank field. As Ian, make sure you're using the correct double quotes (as above - "") and not the 'wonky' quotes you've posted here (ie: “”).

Edit - Glad it's sorted

[Edited on 27-10-2011 by Dom]

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
P.H.P Adam-D General Chat 36 1194
2nd May 03 at 20:34
by Blode
 
ASP Scripts PaulW General Chat 8 1393
27th Jan 04 at 19:42
by VisibleMan
 
php question - need more help :( Dom Geek Day 10 829
22nd Jan 05 at 00:02
by Dom
 
look what came through the post today :-) Jas Geek Day 15 630
1st Dec 06 at 17:28
by aPk
 
VB Scripting With GPO's iceman Geek Day 4 378
1st Apr 09 at 20:32
by pow
 

Corsa Sport » Message Board » Off Day » Geek Day » Scripting: 30 database queries in 0.0155571 seconds