Results 1 to 6 of 6

Thread: form?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    28
    // If the severity is changed to 1,2,3 AND prior severity value was not originally 1,2,3 then email Dev

    code...

    If severity.value= 1,2,3 AND onformopen severity <> 1,2,3 then
    email.value-Dev

    //If the status.value= red, blue, orange, then
    email = Dev + what ever value they picked up in the assign to field

    code...

    ElseIf status= red, blue, orange, then
    email= Dev + Assignto

    // If you come intot he form and the severity is already 1,2,3 then remove QA from the email list

    code...

    Else onformopen serverity.value=1,2,3 then
    email= Assignto


    don't know if my coding is correct, some help would be great! :-)




  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196
    Forgive me if this sounds rude but the "code" that you posted - is that meant to be pseudocode or VB.

    Assuming it is VB, theres a few points worth noting:

    the following type of code:

    If severity.value= 1,2,3 AND onformopen severity <> 1,2,3 then

    should look more like:

    Code:
    If (severity.value = 1 or severity.value = 2 or severity.value = 3) _ 
        AND NOT (onformopen.severity = 1 OR onformopen.severity = 2 OR onformopen.severity = 3) then
    That is, you need to be more explicit with the conditions in your IF statements. Some languages allow you to be more breif, like in some dialects of cobol you can say:

    if a = 2 or 3 or 4

    but in VB <as far as i know> you have to say something more like:

    if a = 2 or a = 3 or a = 4

    i'd like to know if there *is* as shorter way.


  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    28
    whats the _ stand for

    If (severity.value = 1 or severity.value = 2 or severity.value = 3) _

  4. #4
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196
    The underscore is the continuation character - it tells the compiler to look at the next line to find the rest of the current command. An example is best:

    Code:
    'This code would not work
    Dim i as Integer
    i = 1 +
        2 + 3
    
    'You will get an error here because the "2 + 3" does not make sense.

    Code:
    'This code would work
    Dim i as Integer
    i = 1 + _
        2 + 3
    
    'You will not get an error here because the "_" tells the
    'compiler to look at the enxt line so it effectively reads
    '"i = 1 + 2 + 3"
    hope this is clear

    Mark


  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    28
    code
    If (Severity="1" OR Severity="2" OR Sevverity="3 ") _
    AND NOT (onformopen.severity = "1 " OR onformopen.severity = "2" OR onformopen.severity = "3")Then
    Email.Value="Dev"
    End If
    End Sub

    ......would this be right

  6. #6
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196
    Yes,

    assuming that "email" is some control or structure that has a property called value then it looks ok

    oh another thing - you don't have to use the "_" underscore character - it just helps the readability of the code sometimes...

    oh - hang on. If severity is a numeric variable (ie not a string) then you don't need to say:

    severity = "3"

    you say

    severity = 3

    you don't need the quotes...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width