Within a 4D application, you can find specific information regarding hardware (and software) by combining the LAUNCH EXTERNAL PROCESS command and the "system_profiler" shell command.
Here is a quick summary of these 2 commands:
- The LAUNCH EXTERNAL PROCESS command allows the execution of any application that can be run from the Terminal.
- The "system_profiler" Terminal command reports the hardware and software configuration.
Knowing this, we can execute the following code to get the Processor Name and Model Name:
Line 2 executes the "system_profiler" command and stores the result in the text variable $SystemInfo.
Lines 3 and 4 use grep to search the value in $SystemInfo and return the lines that contain "Processor Name" and "Model Name" and store the results in the text variables $ProcessorInfo and $ModelInfo, respectively.
Here is a possible result of executing this code (on a 15" MacBook Pro):
$ProcessorInfo = "Processor Name: Intel Core 2 Duo"
This process could be especially useful if your application is running on different machines and you need to execute different code depending on the machine.
For more information, please see the following links:
LAUNCH EXTERNAL PROCESS