Skip to content

Commit f629cca

Browse files
committed
Alt/CircuitElement: Fix error message in Alt_CE_MaxCurrent
1 parent 25d0d04 commit f629cca

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
- API/YMatrix: check for valid circuit in a few more functions.
2323
- API/Circuit: adjust `SetActiveElement` to be more conformant with the official version, i.e., returns -1 for non-circuit elements.
24+
- Alt/CircuitElement: Fix error message.
2425

2526
## Version 0.14.2 (2024-02-26)
2627

src/CAPI/CAPI_Alt.pas

+2-2
Original file line numberDiff line numberDiff line change
@@ -1158,9 +1158,9 @@ function Alt_CE_MaxCurrent(obj: TDSSCktElement; terminalIdx: Integer): Double; C
11581158
end
11591159
else
11601160
begin
1161-
if (terminalIdx = 0) or (terminalIdx > obj.NTerms) then
1161+
if (terminalIdx <= 0) or (terminalIdx > obj.NTerms) then
11621162
begin
1163-
obj.DoSimpleMsg('Invalid terminal index (%d) provided for "%s". Element has %d terminals. Use -1 for all terminals.', [obj.NTerms, obj.FullName], 97803);
1163+
obj.DoSimpleMsg('Invalid terminal index (%d) provided for "%s". Element has %d terminals. Use -1 for all terminals.', [terminalIdx, obj.FullName, obj.NTerms], 97803);
11641164
Exit;
11651165
end;
11661166
minTerm := terminalIdx;

0 commit comments

Comments
 (0)