Hello
I have several variables (68) consisting of strings, integers, and floats. I am trying to format it using a loop and using if-else condition.
Here's the dataex

Code:
clear all
input str50 var1 int var2 str50 var3 float var4
Sarita            25    Geeta    23.1
mushkanchan 31          Subha    18.9
Kanchandeviparmer    21 Kamla       81.3
Laxmi  23               Subhaparmar    27.1
Ram      21             Sarita        23
Sita      22            Subha     34
Haru       18           Santosh     22
"hari kana" 23       "Santosh K Dash" 23.5
end
The code I used to do the formatting is

Code:
local vars var2 var4
foreach var of varlist var1-var4{

   * Formatting strings
local j : word [Math Processing Error]vars′of  var'
   if j=[Math Processing Error]var′{    format%30s   }   ⋅Forma∈g∫e≥rsandfloats   elseifj=  vars' {
       format %20g
    }
    }
That code has an error. I was trying with if-else condition. But could not succeed. Any help will be greatly appreciated.