Structures Flashcards

1
Q

Checking if an item exist in the structure

A

Isfield(‘name of structure/name of structure.substructure’,’item to check’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Creating Substructure in structure

A

‘Name of structure’.’name of substructure’.’item name’

Eg:
House.size.length=10
House.size.width=20

Variable = struct(field1,value1,struct(subfield1,subvalue1,..),..)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to remove an item in structure

A

‘Name of structure’ = rmfield(‘name of structure/name of structure.name of structure’,’item to remove’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

2 methods to create structures

A

1: ‘name of structure’.’item in structure’ = ‘value’

Eg:

house. size = 10
house. price = 50000

2: ‘name of structure’ = struct(‘item 1’,’value of item 1’,’item 2’,’value of item 2, ….)

Eg:
House = struct(‘size’,10,’price’,50000)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to check the value of an item in a structure

A

Getfield(‘name of structure/name of structure.name of substructure’,’item to check’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly