EnglishРусский  
Share/Save/Bookmark
 

Ads

Perfect Automation tool
All-In-One: Script editor, Launcher, Scheduler, Keyboard & Mouse Recorder. Try now!

CreateInstall
Freeware and commercial installers.

Gentee needs your help!
How to advertise with us
 
laptop battery

with statement

The with construction allows you to simplify addressing the fields of a variable of the structural type. Let us take the following example.

customer mycust

mycust.id = i++
mycust.name = "John"
mycust.country = "US"
mycust.phone = "999 999 999"
mycust.email = "john@domain.com"
mycust.check = mycust.id + 100

As you can see, you have to specify the name of the variable each time. with allows you to drop the variable name inside its block. To do it, specify the variable name after the with keyword and you will be able to specify only the point and the name of the corresponding field in curly braces. You can embed with constructions inside each other.

customer mycust

with mycust
{
   .id = i++
   .name = "John"
   .country = "US"
   .phone = "999 999 999"
   .email = "john@domain.com"
   .check = .id + 100
}

Edit