Jump to content

Generic swap: Difference between revisions

(J: more concise (and more J-like) approach for swapping values of names)
Line 1,280:
 
=={{header|FutureBasic}}==
<lang futurebasic>window 1, @"Swap", (0,0,480,270)
include "ConsoleWindow"
 
text ,,,,, 60
dim as long i, j
 
dim as double x, y
dim as Str15long a i, bj
dim as longdouble i x, jy
dim as doubleCFStringRef xa, yb
 
i = 1059 : j = 62
Line 1,291 ⟶ 1,292:
swap i, j
print i, j
 
print
 
Line 1,297 ⟶ 1,299:
swap x, y
print x, y
 
print
 
a = @"Hello" : b = @"World!"
print a, b
swap a, b
print a, b
 
</lang>
HandleEvents</lang>
 
Output:
416

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.