Home Directory Classifieds Reference Archives
Site Info
About 4DToday.com
Contact Us
Version française
Developers (721)
4D Developers (589)
Web Developers (334)
Tools Publishers (192)
Instructors (164)
Web Hosts (60)
Resellers (87)
Software Publishers (297)
Search Developers
Products (384)
Plug-Ins (111)
Components (48)
Code Libraries (9)
Books (7)
Tools (42)
Vertical Applications (146)
Search Products
User Groups
All User Groups (22)
Classified Ads (21)
Help Wanted (6)
Opportunities Wanted (12)
Hardware Wanted (0)
Hardware for Sale (0)
Software Wanted (1)
Software for Sale (0)
Other (0)
4D, Inc.
4D International
4D Wiki
4D Partner Central
4D Beginner's Center
4D Online Documentation
4D 2004 Example Applications
4D Example Databases
4D BugDisplayer
4D, Inc. Training
Message Lists
4D Mailing Lists
4D Tech Google Group
iNUG Archives (Nabble)
iNUG Archives (Gmane)
iNUG Message Index
4D Code Exchange
4D Resources
Sviluppo4D.it (Italy)
4D Sources (4D Plugin API, 4D Pop & Miyako
The effort of using machines to mimic the human mind has always struck me as rather silly. I would rather use them to mimic something better.
Edsger Dijkstra  
  Suggest a Quote  
Developer News
There are no news items at this time.
 Submit Future News    Archive 
Technical Tip
Pop-up Menu to get a User selected Field
Submitted by Keith Culotta, Computer Dimensions, Inc.

// ----------------------------------------------------
  // Method: popup_MenuFromTablePtr - all menu levels
  // --- Create a Dynamic popup menu with Related One fields & get user's selection
  // INPUT1: Pointer - table of origination
  // OUTPUT:  Pointer - to a User selected field
  // ----------------------------------------------------
  // --- params passed from this method to itself
  // INPUT2: Pointer - table to build this level's menu for
  // INPUT3: Pointer - array of menuRefs to eventually clear, add this menu to it
  // INPUT4: menuref - attach this level's menu to this higher level menu
  // INPUT5: Pointer - array of Table Pointers to prevent a table loop

  // ----------- Sample Calling Method ----------- //
  //$fieldPtr:=popup_MenuFromTablePtr (->[Table_2])
  //If (Not(Nil($fieldPtr)))
  //ALERT(Field name($fieldPtr))
  //End if
  // ----------- Sample Calling Method ----------- //


If (Count parameters>0)

If (Count parameters=1)
ARRAY TEXT($aMenus;0)
$passedMenu:=Create menu
$go:=(Find in array($aTableNumPtr->;$tableNum)=-1)  // - check for circular refs
End if

APPEND TO ARRAY($aMenuPtr->;$passedMenu)

If ($go)
GET FIELD TITLES($tableWorkPtr->;$afT;$afN// omits invisibles
$size:=Size of array($afN)

For ($i;1;$size)

GET RELATION PROPERTIES($tableNum;$afN{$i};$oneT;$oneF)
$fieldName:=Field name($tableNum;$afN{$i})

If ($oneT=0)
APPEND MENU ITEM($passedMenu;$fieldName)
SET MENU ITEM PARAMETER($passedMenu;-1;String($tableNum)+" "+String($afN{$i}))

  // in case the relation does not use UUID, it may be useable in the list
GET FIELD PROPERTIES($tableNum;$afN{$i};$fType;$fLength)
If ($fType#0) | ($fLength#0)
APPEND MENU ITEM($passedMenu;$fieldName)
SET MENU ITEM PARAMETER($passedMenu;-1;String($tableNum)+" "+String($afN{$i}))
End if

APPEND TO ARRAY($aTableNumPtr->;Table($tableOrigPtr))

$newMenu:=Create menu
popup_MenuFromTablePtr ($tableOrigPtr;Table($oneT);$aMenuPtr;$newMenu;$aTableNumPtr)
APPEND MENU ITEM($passedMenu;"["+Table name($oneT)+"]";$newMenu)
SET MENU ITEM PARAMETER($passedMenu;-1;String($tableNum)+" "+String($afN{$i}))

End if

End for

If ($topLevel)

$ans:=Dynamic pop up menu ($passedMenu)

For ($i;1;Size of array($aMenus))
RELEASE MENU($aMenus{$i})
End for

If ($ans#"")
ARRAY TEXT($aWords;0)
End if

End if

End if

End if
  Submit a Tip    Archive 
Active4D 64-bit
Active4D 64-bit Active4D is now available for 4D v12 64-bit Server! Take full advantage of your 64-bit hardware with the power of Active4D.
  Suggest a Spotlight  
Survey Question
Today, we ask you...
Still working on survey, please vote for debugging purposes...
What is your basic, average hourly rate for 4D consulting? (In US Dollars)
$0 - $50
$51 - $75
$76 - $100
$101 - $150
$151 - $200
$201 - up

Survey submitted by Tim Nevels
  Show Results (no vote)    Suggest a Survey  
There are no events scheduled for the upcoming fortnight.
  Submit an Event