-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-input-function-params.ipf
127 lines (90 loc) · 2.49 KB
/
test-input-function-params.ipf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// functions with parameters
Function myFuncParam1(var1)
variable var1
end
Function myFuncParam2(var1, str1)
string str1
variable var1
end
Structure myStructType
variable v1
EndStructure
/// This function has structure parameters, which are always call-by-reference
///@param w1 input wave
///@param str1 fancy version string
///@param myStruct1 first working struct
///@param myStruct2 second working struct
///@param myStruct3 third working struct
Function myFuncParam3(w1, str1, myStruct1, myStruct2, myStruct3)
struct myStructType& myStruct1
struct myStructType & myStruct2
struct myStructType &myStruct3
Wave/T w1
string str1
end
Function myFuncParam4(param)
struct myStructType& param
end
// normal parameters using call-by-reference
Function myFuncParam5(param, [str1])
struct myStructType& param
string& str1
end
// multiple return value syntax, introduced with IP8
Function [int64 out1, variable out2] myFuncParam6(int64 in)
return [out1, out2]
end
Function [int64 out, struct myStructType s, WAVE/T textwave] myFuncParam7(int64 in, [variable opt])
return [out, s, textwave]
end
Function [string data, string fName] myFuncParam8(string fileName[, string fileFilter, string message])
return ["", ""]
End
Function [DFREF dfr] ReturnSomeFolder()
End
// function modifiers
static Function myFuncS1()
End
static Function myFuncS2(var)
variable var
End
threadsafe static Function myFuncST1()
End
threadsafe static Function myFuncST2(var)
variable var
End
override Function myFuncSTO1()
End
override Function myFuncSTO2(var)
variable var
End
// and this is not a function declaration
SomeStuff Function notAFunc()
Function Proto()
End
Function Test1(variable a, string s, wave w, dfref d, funcref Proto f, struct RECTF &st, int i, int64 i64, uint64 ui64, double do, complex c, [variable opt])
End
Function Test2(variable &a, funcref Proto f, [string &s])
End
Function Test3(struct RECTF& s [, string s])
End
Function/S TestWithNastyPrefix(waverefs)
Wave/WAVE waveRefs
End
Structure MyStruct
int32 count
EndStructure
Function PA_ApplyPulseSortingOrder(WAVE setIndices, STRUCT MyStruct &myStruct)
End
Function PA_GatherSettings(win, myStruct)
string win
STRUCT MyStruct &myStruct
End
Function/S MyFuncWithOnlyOptionalParameters([variable channelType])
End
Function MyFunc(WAVE/C wv)
End
Function [WAVE outNum, WAVE/T outText] MyFuncyFunc(WAVE/D/Z param1, WAVE/T/Z param2, WAVE/Z/I param2, WAVE/R/Z param3, WAVE/C/Z param4)
End
Function Func( Variable b, Variable c )
End