Results 1 to 3 of 3
  1. #1
    beaurou is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    16

    Visual foxpro function Normalize()

    This is a portion of a VisualFoxpro code that I try to translate in VBA, my problem is the Normalize() function (in RED). I read a lot on the internet about it but I'm still confuse on how it work. Does something exist in VBA to do the same thing.

    'Retrieve the x and y data values
    If LoadDataArrays("SHIP SPEED PPD", sngXValues, sngYValues) Then
    'Call the function to normalize the independent variable value
    If Normalize(txtOrderKnots.Text, sngNormalizedX, sngXValues) Then
    'Call the function to calculate the value of the dependent parameter

    If Look1D(sngNormalizedX, sngPPD, sngYValues) Then
    'Determine which schedule to use
    If (cboDriveMode.Text = "1 GT") And (cboDemand.Text = "Normal") Then
    strSchedName = "PLA DEMAND FOR 1 GT DRIV"
    ElseIf (cboDriveMode.Text = "2 GT") And (cboDemand.Text = "Normal") Then
    strSchedName = "PLA DEMAND FOR 2 GT DRIV"
    ElseIf (cboDriveMode.Text = "1 GT") And (cboDemand.Text = "Silent") Then
    strSchedName = "SILENT DMD FOR 1 GT DRIV"
    ElseIf (cboDriveMode.Text = "2 GT") And (cboDemand.Text = "Silent") Then
    strSchedName = "SILENT DMD FOR 2 GT DRIV"
    End If

    If LoadDataArrays(strSchedName, sngXValues, sngYValues) Then
    'Call the function to normalize the independent variable value
    If Normalize(sngPPD, sngNormalizedX, sngXValues) Then
    'Call the function to calculate the value of the dependent parameter
    If Look1D(sngNormalizedX, sngPLA, sngYValues) Then
    bPLAFound = True
    End If
    End If
    End If
    End If
    End If
    End If

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    What does Normalize() do? Even after reading http://msdn.microsoft.com/en-us/subs...(v=vs.71).aspx I am not sure what it accomplishes and what purpose it serves in this code.

    The If Then condition is expecting a True or False return from the Normalize() function. The article shows the function has only one argument and you show 3. What are the content of textOrderKnots.Text, sngNormalizedX, sngXValues, sngPPD? How will Normalize() process them to return a True or False? Why do you reference Text property instead of Value?

    Also, what are LoadDataArrays() and Look1D() - custom UDFs?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    Visual Foxpro does have a Normalize function, but it appears your application may have replaced the built-in function with something else.

    In your code, what is Normalize supposed to do? It looks like it is performing some sort of statistical manipulation.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Importing a FoxPro table using VBA
    By MarkGallie in forum Programming
    Replies: 2
    Last Post: 04-26-2013, 04:00 PM
  2. I am so confused on how to normalize the data? please help???
    By coffayndtea in forum Database Design
    Replies: 2
    Last Post: 03-28-2012, 07:52 PM
  3. To normalize or not
    By blazerboy6 in forum Database Design
    Replies: 5
    Last Post: 08-10-2011, 02:58 PM
  4. foxpro in access
    By meysam_e2006 in forum Import/Export Data
    Replies: 0
    Last Post: 06-28-2010, 02:17 AM
  5. Access vs FoxPro
    By khuram in forum Access
    Replies: 5
    Last Post: 06-16-2009, 11:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums