There's a scripting command for that, Distance(). Check out the documentation in the Scripting Index (Help > Scripting Index).
The trick will just be using the same vector or matrix for both arguments. Here's some examples:
//1-D example
x = [1, 2, 3, 4];
D = sqrt(Distance( x, x ));
//2-D example
x2 = [1 1, 2 2, 3 3, 4 4];
D = sqrt(Distance( x2, x2 ));
If your data is in a table, see the commands Get As Matrix (to get an entire data table as a matrix) and Get Values (e.g. col1 << Get Values) to get a specific column as a vector. You can also find these in the Scripting Index and Spripting Guide (Help > Books).
-- Cameron Willden