我想知道在FORTRAN中是否有類似的東西。當然這個例子不能編譯,但我認爲你可以得到這個想法, program test
character(1):: sub
sub='A'
call sub
sub='B'
call sub
end program
subroutine A
print*,'OK! A'
end subrou
我在將子程序中的變量帶入另一個子程序時遇到了一些麻煩。 下面是代碼: def loop1():
try:
age=int(input("How old are you? "))
except ValueError:
print ("Please enter a numerical integer of your age. For example: 19
我有一個子塊,它以塊的形式讀取FASTA文本文件。 sub reader {
foreach my $line (<IN>) { # read line by line
chomp $line;
if ($line =~ m/^>/) { # if it's a title
&initiator($title, $seq) unless $first
我已經通過子程序做印刷哈希鍵/值對一個簡單的Perl腳本 #!/usr/local/bin/perl
#passing hash to a subroutine
sub printhash{
my (%hash) = @_;
foreach my $key (keys %hash){
my $value = $hash{$key};
使用VB.Net 4和VS2012 我有這樣的在它的一些邏輯模塊: Module Mod1
If x = 1 then
Mod2("Mod3","save_it")
else
Mod2("Mod4","edit_it")
end if
End Module
Module Mod2(which_mod, which_action)